Message Boards Message Boards

0
|
1515 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Find rows in a dataset that include a given keyword

Posted 2 years ago

Problem: If I use the following code;

dataset[Select[#"Column 1" != "" &]]

I get all rows that do not have an empty string, and if I use the code;

dataset[Select[#"Column 1" != "Help" &]]

I get all rows that do not include the string "Help".

Question: How do I get all rows that do not contain the keyword help? I can't understand why there isn't, or seem to find, a simple way to indicate that "Help" is not the entirety of the string, which is frustrating me.

Your help would be much appreciated.

Sincerely, Lewis

2 Replies

Thanks Rohit! Ok, now I'll check out the guide page.

Posted 2 years ago

Hi Lewis,

One way is to use StringContainsQ

dataset[Select[Not@StringContainsQ[#"Column 1", "Help"] &]]

Take a look at the guide page on string patterns.

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

Group Abstract Group Abstract