Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.9K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

Find rows in a dataset that include a given keyword

Posted 3 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
Posted 3 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

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

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