Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.9K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Outlier deletion in dataset?

Posted 5 years ago

Hello, I have a dataset with 1400 rows and 12 columns, I have found the outliers, I have the row numbers currently, I am unable to find a way to delete those rows from the dataset. I am confused about using a function to delete the rows or are there any inbuilt functions?

Let data be my dataset, and pH is my column, so I am checking here if my pH is less than 2.8 then the position of those values are returned

Newdata[Select[#pH < 2.8 &]] // (Position[Newdata, Alternatives @@ #] &) // Flatten

The returned value is {136}. How do I delete this particular row from my dataset. Thanks in advance.

POSTED BY: Srajan Rai
2 Replies
Posted 5 years ago

Hi Srajan,

Dataset is immutable. So, to remove rows with pH < 2.8.

cleanData = Newdata[Select[#pH >= 2.8 &]]
POSTED BY: Rohit Namjoshi
Posted 5 years ago

Hi Rohit,

The solution worked as required, Thank you

POSTED BY: Srajan Rai
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard