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.

2735 questions
0
votes
0 answers

PSM: reproducing results from kmatch with psmatch2 in Stata

I am working on Propenstiy Score Matching with Stata 17. I use userwritten command kmatch to automatically estimate the bandwith for kernel matching, but I prefer the balancing outputs of psmatch2. Hence, I estimate the optimal bandwith with kmatch,…
Anis
  • 5
  • 3
0
votes
1 answer

Return matched pattern from vector - R

I'm trying to write code which adds a new column to a dataframe, returning a pattern which has been matched to the respective cell in a different column. For example, I have a column where the values are a string with a mix of useful and non-useful…
0
votes
1 answer

Extract rows between sequential pairs of values in list from another dataframe

I have a df of indices corresponding to special events that occur in each trial in a study. The indices are really pairs (2 per trial) that specify the beginning and end of the special events. event_df.head(16) subject trial indices 0 …
B_Sil
  • 5
  • 3
0
votes
0 answers

Infinite Loop in Blossom/KolmogorovWeightedPerfectMatching algorithm

I'm trying to use the Blossom algorithm in JGraphT to create a pairing between a set of teams using costs based on whether they have already played each other and what their relative point difference is (i.e., Swiss-like). But in every 5000 or so…
vorboyvo
  • 9
  • 2
0
votes
0 answers

psens() function of rbounds package in RStudio stogether with the Matching package

so i would expect the psens() function of the *rbounds *package i am using to do a rosenbaums sensitivity analysis for my matched data to work with an object created with the match() function of the *Matching *package. psens(mgen1, Gamma=1.7,…
0
votes
1 answer

Reformat prettyphoto Vimeo Player embed expression

I'm having trouble with prettyphoto outputting the video embed links in the wrong order for unlisted videos, resulting in the video player stating that the video does not exist. Background: the video link will be something like…
0
votes
0 answers

How to bring column value from another data frame in python?

My df1: df1 = pd.DataFrame({'Col1' : ['A_B_C', 'A_B_C', 'A_B_C', 'D_E_F', 'D_E_F', 'G_H', 'A_B_C'], 'Col2' : ['red', 'red', 'red', 'ash', 'ash', 'green', 'red']}) df1 My df2: df2 = pd.DataFrame({'ID_Number' : [100, 200, 300,…
s_max
  • 13
  • 4
0
votes
1 answer

scala 3 map tuple to futures of tuple types and back

I'm trying to take an arbitrary tuple of Futures and return a tuple of the completed future's values, while providing a time limit for the completion of the futures. I'm trying to use Tuple's provided Map match type: def getAll[T <:…
anqit
  • 780
  • 3
  • 12
0
votes
0 answers

Compare Python files (.py) and replace values of variables if the same variables present in the same section

I have two python files: clean_file.py and settings_QA.py. I want to do the following: Read the files clean_file.py and settings_QA.py Create a new file called settings_QA_clean.py Write the contents of clean_file.py to settings_QA_clean.py Replace…
0
votes
0 answers

Efficiently matching a Hash/Map with multiple Hashes/Maps

I have a base Hashmap something like below { "group_reassigned_count": 3, "source": "App", "description": "Sample", "company_id": 753606, "group_id": 706200, "custom_text": "Item 1", "custom_number": 45, "custom_decimal": 34.5, …
Ramesh RV
  • 72
  • 7
0
votes
2 answers

Matching two files with awk codes

There are two files first.file M1 M2 M3 ... second.file A1 M1 A2 M1 A2 M3 A3 M2 A3 M4 A3 M5 .... I want to match first.file to second.file My result file should be like that: result.file A1 M1 A2 M1 A2 M3 A3 M2 How can I do that with awk…
user951487
  • 845
  • 7
  • 19
  • 30
0
votes
1 answer

Matching values between a vector and a list within a matrix, then sampling from another list in the same matrix using the index from the match in R?

Sorry, I'm a bit jumbled in my thoughts to ask this in any articulate manner. My apologies if this doesn't make total sense. Also I'm mostly self-taught with R, so if I don't do something very efficiently, please forgive me and feel free to correct…
JHo
  • 45
  • 4
0
votes
1 answer

How to pick the nearest date above a certain date in one dataframe from another

So I have two dataframes, "df1" and "df2" (see code below). I want to create a new variable in "df1" by iterating trough the elDate variable in "df2", and picking the closest elDate value above the date value in "df1". For example, the first row in…
bitte
  • 3
  • 2
0
votes
1 answer

Windows CMD for matching files to directories

I have a Windows CMD script that has a bug. The script is supposed to match the first 8 digits (the date) of a file with a directory titled with the same first 8 digits (the date). If successful, the file is moved into that directory & placed in a…
0
votes
2 answers

How to join to datasets with inconsistent company names?

I have an issue joining two datasets with companies that have inconsistent names. In the first dataset, I have event data which consist of Company Name, Company ID, etc. In the second dataset, I have all the information about the company, including…
Hao Pan
  • 1
  • 1