Questions tagged [partial-matches]

49 questions
34
votes
3 answers

Filter multidimensional array based on partial match of search value

I'm looking for a function where given this array: array( [0] => array( ['text'] =>'I like Apples' ['id'] =>'102923' ) [1] => array( ['text'] =>'I like Apples and Bread' ['id'] =>'283923' ) [2] => array( ['text'] =>'I like…
Chamilyan
  • 9,347
  • 10
  • 38
  • 67
18
votes
2 answers

Abbreviation of "collapse" in paste?

Using the command paste in R, I wanted to use both arguments sep and collapse, but you cannot abbreviate collapse to coll or even collaps. Yet for other functions partial abbreviation works. For example: paste(letters, colla=", ") # [1] "a , " "b ,…
user1879178
  • 181
  • 2
8
votes
9 answers

How to check if values in first dataframe are contained or match values in another dataframe

I am using R to work with some dataframes. My issue is related on how to check if values in a variable in a first dataframe match with values in another dataframe. The match is very different to those like merge or join. I will introduce my…
user007
  • 347
  • 1
  • 3
  • 12
4
votes
5 answers

How to match rows in array to an array of masks?

I have array like this: array('1224*', '543*', '321*' ...) which contains about 17,00 "masks" or prefixes. I have a second array: array('123456789', '123456788', '987654321' ....) which contain about 250,000 numbers. Now, how can I efficiently match…
canni
  • 5,737
  • 9
  • 46
  • 68
3
votes
1 answer

Fuzzy matching two data frames

I want to merge two data frames df1 and df2. df1<-tibble(x=c("FIDELITY FREEDOM 2015 FUND", "VANGUARD WELLESLEY INCOME FUND"),y=c(1,2)) df2<-tibble(x=c("FIDELITY ABERDEEN STREET TRUST: FIDELITY FREEDOM 2015 FUND", "VANGUARD/WELLESLEY INCOME FUND,…
Jane
  • 91
  • 4
1
vote
3 answers

How to extract common elements over two lists of strings - python

I am trying to match two lists of strings with names that are written differently and have partial matches: list1 = {'ADELA SARABIA', 'JUAN PEREZ', 'JOHN ADAMS', 'TOM HANKS'} list2 = {'JOSE GARCIA', 'HANKS TOM', 'PEREZ LOPEZ JUAN', 'JOHN P.…
1
vote
1 answer

KQL: Exclude partial string from results using Sentinel Watchlists

Using a watchlist to store domains to be excluded from this query. However unable to filter out the domains on the watchlist from the results. Dealing with SMTPS. The Watchlist items do not contain the "@" symbol. Watchlist…
CurlyCrank
  • 13
  • 3
1
vote
1 answer

R code to merge 2 data frames by whether values in the first "by" variable contain string values in the second "by" variable

I have 2 data frames: one with a list of medications, the other with a different but highly overlapping list of medications along with corresponding medication ID codes. I want to merge these two data frames to apply the medication codes to the…
1
vote
3 answers

Filter flat array by checking if key contains one of several qualifying substrings

I have an array made up of data provided by a WordPress plugin, which looks something like this: array( [label] => Evening, [hour] => 15, [minute] => 00, [add_time] => enabled, [zlzkrrwlwchehhtvdnmq_add_date] => 29 November…
Emma W
  • 671
  • 1
  • 7
  • 23
1
vote
1 answer

Complex partial string matching in pandas

Given a dataframe with the following structure and values json_path - json_path Reporting Group Entity/Grouping data.attributes.total.children.[0] Christian Family Abraham Family data.attributes.total.children.[0].children.[0] Christian…
William
  • 191
  • 5
  • 32
1
vote
1 answer

subsetting data frame columns in a particular order by partial string matching

I'm stuck with an attempt to subset columns in order from a very wide formatted dataframe. 1 row, couple thousand columns. column names are repetitive so they are all tagged with "...1/2/3/4/5" when retrieved and readin by R sample…
ML33M
  • 341
  • 2
  • 19
1
vote
1 answer

How do I search for a value in a different sheet, possibly within a string of text

I have values I need to search for within another sheet (4 columns), the fourth column's cells containing strings of text. I need a formula that is able to search for and count how many times the value shows up in the other sheet, even within a…
1
vote
2 answers

awk - partial match of several columns between two files and return a one liner of both files concatenated with comma

I have two files, each one contains the following: /tmp/mydir-1: direction=1, code=a b c d, time=xxxx direction=1, code=f x fdfsdf sdfs, time=xxxx direction=1, code=a b c f, time=xxxx and the 2nd file /tmp/mydir-2: direction2=2, code2=a b c fsd,…
ufk
  • 30,912
  • 70
  • 235
  • 386
1
vote
2 answers

subset pandas df columns with partial string match OR match before "?" using lists of names

I hope someone might help me. I have a dataframe that inculdes columns with similar names (see example data) I have 3 additional lists of column names which include the original names of the columns (i.e. the string occurring before the question…
b101
  • 287
  • 1
  • 8
1
vote
1 answer

How to extract all matching patterns (words in a string) in a dataframe column?

I have two dataframes. one (txt.df) has a column with a text I want to extract phrases from (text). The other (wrd.df) has a column with the phrases (phrase). both are big dataframes with complex texts and strings but lets say: txt.df <-…
ayeh
  • 48
  • 10
1
2 3 4