Questions tagged [matching]
For questions related to pattern matching, using character sequences or tree structures. In contrast to pattern recognition, the match described here usually has to be exact.
2,594
questions
-1
votes
0
answers
19
views
Matching data between an excel sheet and a csv
I’ve been working on a project to gather files info and finally I finished 2 sheets the one that contains the (file_name.extension) we need to allocate and on the other side I have a csv file ...
0
votes
1
answer
20
views
Partial Case-Insensitive String Search in R
I have a spotify$gens column where it contains all the descriptions of genres of each album.
For example:
head(spotify$gens) gives
gens = c("Jazz Fusion", "Latin Rock, Progressive Rock&...
0
votes
1
answer
36
views
How to match one row from one column to the next 5-10 rows in two other columns in R?
I have a data frame which looks like this:
df1 <- structure(list(day = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20), observ1 = c(1, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, ...
0
votes
1
answer
29
views
How to check which words from a list are contained in a string?
I was looking to collect each word from a list that is included in a string in python. I found some solutions but so far i get:
data = "Today I gave my dog some carrots to eat in the car"
...
0
votes
1
answer
29
views
Search through two dataframes in R to match values from one column to the other
That title might be confusing so it might be easier to show what I'm trying to do. This is what the first data frame looks like:
city
code
population
dallas
NA
18
chicago
NA
24
new york
NA
13
...
0
votes
0
answers
53
views
Powershell - How to replace a line of text that contains words -like "xyz*"
I have a pipe line already constructed and retrieving my expected results.
I want to now replace a whole line if a certain match is found then export the whole lot to a text file, with changes if it ...
0
votes
1
answer
49
views
Oracle SQL - matching different rows by multiple fields
I am trying to solve the matching of different customers, from different entities. Using only SQL select and "with" syntax, no PL/SQL. Below is a simple example. There are three customers, ...
2
votes
0
answers
29
views
How to match array of values to another array of traits?
I need to divide a list of unique traits (for example ["Top","Middle","Bottom"], three of five traits) between sets of different percentages that describe the traits, ...
0
votes
0
answers
30
views
Match objects of two lists of different sizes efficiently?
I need help with a coding challenge.
The task is to match train arrivals and departures given as two seperate unsorted lists of different sizes. Each containing the train number and a dateTime. If a ...
1
vote
1
answer
29
views
Several columns matching over 2 data.frames
I have two large, messy datasets. The structure of the variables for this issue roughly looks like this:
First, a dataset containing some IDs.
DF1 <- tibble(
ID1 = c(1, 2, 3),
ID2 = c(4, 5, NA)...
-2
votes
0
answers
43
views
Matching of two 1D numpy arrays
In my head this should be super simple, but I cannot figure this problem out. I would like someone to help me, to put my mind on the right track.
I've two numpy arrays, a ground truth array and a ...
1
vote
1
answer
18
views
Matching Numbers that are Close in Value in Alteryx
I have two different datasets with different values in Alteryx. The one dataset serves as a lookup table for the other.
For example:
Name Code Source
==================
Al 124.5 A
Bill ...
0
votes
1
answer
18
views
How to (efficiently) retrieve the value of a column in a different row based on matching IDs?
I'm trying to do what I did in the example below, but on a large scale so Ideally the solution is as efficient as possible. Thanks in advance!
ID1 <- c("a", "d", "c", &...
4
votes
3
answers
68
views
Regex match any of the words separated by slashes
I need to develop a validation pattern for catching any kind from:
pdf/csv/xlsx
select any separate word is simple:
(pdf|csv|xlsx).
However, I need to check that any combination with them ...
0
votes
1
answer
166
views
fuzzy matching of nested data (ex: individuals \in families \in groups)
I am trying to match groups across two datasets, D1,D2. Each dataset represents the groupings at time t=1 and t=2.
Assume that the data have 3 nested levels:
i: individuals have characteristics: X,Y,...
0
votes
1
answer
21
views
match any number of consecutive words following a backslash
I'm trying to match a TeX command, i.e. a backslash followed by a word (in a desired list) using regex, but with any number of them. For example, if the list I want is test, other, list, then the ...
0
votes
1
answer
18
views
How can I match data from two excel sheets?
Have a question about matching data.
I have two excel files one in the extract of the database which is updated once a while and doesn't hold all records because it is not linked to the source ...
1
vote
1
answer
35
views
Create new column in dataframe based on another and matching to another dataset in R
I've the following data frame and I would like to create a new column based on the following conditions:
If Price.of.Books is BLANK, R will look up to the matching data frame based on the value in ...
-1
votes
0
answers
43
views
Greatest number of coupons a customer can apply: Combinatorics problem similar to the stable roommate problem (Javascript)
I am struggling with an algorithm (javascript). If anyone can help, I would greatly appreciate it.
Given an an array of a customer’s coupon ids, an array of a customer’s item ids, and an object with ...
-2
votes
1
answer
36
views
awk: if pattern is matched append some data
I have a data set created by a tool with file name test.deg. The file contents is as follows:
1 I0.XPDIN1 1.581e-01 1.507e-01 3.662e-04 3.891e-02
2 I0.XPXA1 1.577e-01 1....
0
votes
2
answers
70
views
What would be the regex pattern for the following?
I have multiple regex strings in format:-
Example:
A='AB.224-QW-2018'
B='AB.876-5-LS-2018'
C='AB.26-LS-18'
D='AB-123-6-LS-2017'
E='IA-Mb-22L-AB.224-QW-2018-IA-Mb-22L'
F='ZX-ss-12L-AB-123-6-LS-2017-BC-...
1
vote
2
answers
51
views
Merging dataframes into dataframe format by matching rows AND columns
Recently I have started using R again. I am having problems with the following problem:
I have created a dataframe format in which I want to merge smaller dataframes into, based on both the columns ...
0
votes
1
answer
42
views
Awk - print matches and non matches in same file
I have two pretty large files each with 3 columns. Columns 1 and 2 are pairs and must both match to columns 1 and 2 in the second file (in the same order). If columns 1 and 2 from File 1 match in File ...
-1
votes
3
answers
27
views
Cannot pattern match patterns ending with specific characters
I'm trying to match all patterns that end in bar.
This is my regex pattern ".*bar$".
I get no result... same thing happens if I use the carrot in to match at the beginning of patterns.
...
0
votes
0
answers
13
views
Matching values in an iterative way in pandas
I have got a pandas dataframe including data from two different dataframes and I need to match and produce scores in an iterative way for each row based on their index (header) as in the image below. ...
0
votes
2
answers
40
views
Find matching id between multiple record in two table
I have the following table structure:
table_book_user
book_id | user_id
--------+---------
b1 | u1
b3 | u1
b2 | u1
b4 | u2
b5 | u2
b5 | u3 ...
2
votes
1
answer
39
views
Persons Matching program or algorithm
In a networking event there is a pool of persons. Each person should meet all other persons in a 5 person setting for 10 minutes.
For example if the pool is having 60 persons. Each person should meet ...
-3
votes
2
answers
35
views
PYTHON USING PANDAS LIBRARY TO GET RECORD:--
A table in the database containing STATION and CITY. I just want RESPECTIVE STATION for a list of CITY NAME in python using the panda's library.
df=pd.DataFrame(pd.read_sql('SELECT * FROM REGION', ...
2
votes
1
answer
78
views
R counting rows that meet criteria for all possible column pairs
I have a data frame df.
ID 001-alpha 001-sigma 001-delta 001-gamma 002-alpha 002-beta 002-charlie 002-delta
12 1 2 3 3 2 NA ...
0
votes
0
answers
24
views
Glob Pattern ignore with File I/O not working (dotnet)
I'm trying to build a scan loop that recursively scans a given folder and collects all files within it. If at any time a .ignore file is found within, it will open it up and apply those glob style ...
0
votes
2
answers
56
views
perl amino acid quiz in arrays
i'm learning perl, and i'm trying to write a program asks you to pick an amino acid and then keeps (randomly) guessing which amino acid you picked.
I would like to do it with arrays. so I declare ...
0
votes
1
answer
20
views
Compare 2 Text column of 2 Data frame by consecutive letter in R
I've the following 2 dataset: The original dataset and the matching dataset. The matching dataset is used to match against the original dataset.
Original Dataset
MelbourneAir
MelbourneCityAir
...
0
votes
0
answers
19
views
Can I use "edge merge" operation with networkx algorithms? (for Graph Edit Distance)
I tried to compare and find node matching between two similar graphs
Edge of these graphs has an attribute of string list such as ["A", "B"]
Now I am using graph edit distance ...
0
votes
1
answer
38
views
How to approach Stable Marriage Problem with restricted pairs
Let's say we have a version of the stable marriage problem with the addition that some pairs are restricted based on certain preferences, e.g. whether or not someone lives in a different city and ...
0
votes
0
answers
23
views
Keep data in that is +/- 1 hour matching with date and site ID between 2 data frames in R [duplicate]
I have 2 tables (data1 and data2). My goal is to keep data in data2 that matches with "Site" and "Date" in data1 and also is within +/- 1 hour of data1. I have an example of what I ...
1
vote
0
answers
36
views
Student-group allocation algorithm
I have 150 students, and have to assign them to specific groups (with different topics). They can rank their preferences for the topics and will each have different groups. My main issue (more than ...
1
vote
1
answer
58
views
Binary Matrix shifting and matching
I have two binaries matrices. I want to compare these two matrices and find the maximum matching by shifting rows up and down and shifting columns right and left. For example: I have matrix a= [1 1 1; ...
0
votes
3
answers
53
views
Excel Function Counting Cells with Criteria
I new at using Excel and need help. I have a sheet that contains operations and headers that represent names but for confidentiality it is letters. What I am trying to do is find the max,min within ...
0
votes
0
answers
31
views
date matching between fields
/*
I have some records I need to filter through. The 2nd field must match the first field of the next record and the max hier_record_starting must be the final record. so I need a query that pulls ...
1
vote
1
answer
49
views
Howto do this in Dartt $current_segment =~ s/([a-zA-Z]+)\.([a-zA-Z]+)/$1 punto $2/g;
I do appreciate if anyone could help me with this seemingly easy question:
$someText =~ s/([a-zA-Z]+)\.([a-zA-Z]+)/$1 : $2/g;
This perl statement finds all patterns of the form www.xyz and changes ...
0
votes
0
answers
24
views
How does matchit subclass look so complicated?
I am trying to match test/control using a string that concatenates different values (for example: 1_4_5). I ran matchit using exact matching for the variable above and mahalanobis for 2 or 3 other ...
1
vote
1
answer
39
views
Match header and values, mutliline using regex
I have a document with the following structure:
A header (some text without any whitespace in the same line)
A list (could be empty) of values:
Each value starts with a tab character, and then is ...
1
vote
1
answer
53
views
SML - See if two unordered lists are equal (have same values, and the values appear the same amount of times)
Like the title says, I'm trying to see if two unordered lists include the same values and if these values appear the same amount of times in these lists. The assignment given asks not to order the ...
-1
votes
2
answers
55
views
GNU AWK Print Text Between Two Patterns Do Not Include Patterns
GNU AWK 5.1.1
I have an AWK expression below that I use to print the content between two patterns found in a .txt document but I'm not particularly happy with the expression, would like something more ...
0
votes
1
answer
31
views
PUBG like matching feature
I want to create the website where I want the PUBG feature like matching the online gamers and set the game between them, so I just wanted to know how I can do that whoever users are online on my ...
0
votes
0
answers
8
views
LINUX : How to match a portion of filenames for an if loop?
I have a pool of files with a unique code included in their filenames. There are two files for each unique code that I need to match in order to execute a command with them.
Sample of files:
...
0
votes
1
answer
41
views
Replace text in a string and ignore matches within HTML tags
For a given string (typically a paragraph) I want to replace some words/phrases but ignore them if they happen to be surrounded by tags in some way. This also needs to be case-insensitive.
Using this ...
2
votes
1
answer
84
views
How to check for matching properties using a JSON schema?
I'm making a Discord bot in Python that reacts to certain keywords in messages and my script uses a JSON file that might for example look like this:
{
"characters": {
"john&...
0
votes
0
answers
12
views
How to match IVR data with Call Centre Data by datetime
I have two systems IVR and Call Centre. The first call comes to IVR then routed to the Call Centre.
Not all calls go to Call Centre, some are contained in IVR itself.
I need to match IVR and Call ...
0
votes
1
answer
31
views
Shell string pattern matching : var="this is a test"; echo ${var#t?st} match nothing
I am studying bash shell scripting.
var="this is a test"; echo ${var#t?st}
or
var="this is a test"; echo ${var#test}
result
this is a test
I know that hashnet will delete the ...