Skip to main content

All Questions

Tagged with
0 votes
1 answer
36 views

Combine dataframes fuzzy matching on time

I have two dataframes, dfA and dfB, whose primary key is an ID and a datetime object each stored in a column. I wish to merge these dataframes on the ID & time if the ID is identical AND if the ...
user8793002's user avatar
1 vote
1 answer
52 views

How to merge dataframes over multiple columns and split rows?

I have two datafames: df1 = pd.DataFrame({ 'from': [0, 2, 8, 26, 35, 46], 'to': [2, 8, 26, 35, 46, 48], 'int': [2, 6, 18, 9, 11, 2]}) df2 = pd.DataFrame({ 'from': [0, 2, 8, 17, 34], ...
BRat's user avatar
  • 83
0 votes
0 answers
32 views

Merging 3 DataFrames with a Bespoke Format [duplicate]

I am an apprentice doing my first project using Pandas so apologies if I get any terms wrong or if my question is very obvious. I am trying to collate the information of 3 DataFrames using UniqueID as ...
Afraid_Concentrate44's user avatar
0 votes
1 answer
50 views

Indices mismatch during merge in pandas

I am trying to merge two dataframes in Python, pandas, df1 and df2. I am trying to merge them on Column1, and then assign value of Column2 from df2 to df1. This is my code: df1 = df1.reset_index() ...
melca's user avatar
  • 23
1 vote
1 answer
65 views

Pandas: Merge by common column retaining all other columns and sort by common column [duplicate]

I have two DataFrames, both of which have an x column and a y column. The x values are unique within each DataFrame, but there is some overlap between the two. I want to merge the two DataFrames, ...
Brain Bytes's user avatar
1 vote
2 answers
83 views

dataframe easily implement merge_asof

I have two dataframes: time_start = datetime.datetime.strptime('2024-02-01 10:00:00', "%Y-%m-%d %H:%M:%S") interval_l = [1, 7, 14, 17, 21, 22, 31] df_l = pd.DataFrame(index = [time_start + ...
user6703592's user avatar
  • 1,136
0 votes
2 answers
75 views

how to make pandas merge without inner data

how to make pandas merge without inner data? input: inner_df = pd.merge(df1, df2, on='user', how='inner') outer_df = pd.merge(df1, df2, on='user', how='outer') so i don't need inner data i need only ...
user avatar
0 votes
1 answer
34 views

Is there a smart way to merge 2 DataFrames based on substring criteria?

I'm currently working with some phones numbers DataFrames and I need to merge them in a substring criteria way and has to be an left merge (meaning to have all combinations in case there is more than ...
Kadooken's user avatar
0 votes
2 answers
63 views

how to merge dfs without duplicate lines

My dataframes are similar to below df1: user name length job 0 5234 Ed 7 manager 1 4793 Mark 14 admin 2 9321 Nick 8 admin 3 8149 Duncan 3 admin 4 ...
Ed Jefferies's user avatar
-2 votes
1 answer
74 views

Combining data with multiple dates into one row for each case

I have a bunch of data and each row has a 4 date fields. The first date field is a duplicate for the ID number and sometimes not. It looks a little like this: ID,LName,FName,DateIn,DateOut,Days,...
ThatOneGirl's user avatar
0 votes
0 answers
16 views

Merging two pandas dataframe with repeated primary keys [duplicate]

I have two pandas dataframe that looks like df1= Class_ID Student_ID feature1 1 4 54 1 7 24 1 9 865 2 23 342 ...
Apook's user avatar
  • 449
-1 votes
1 answer
63 views

How do I perform a smear between two dataframes in python/pandas? [duplicate]

I have two dataframes and I need to perform a smear (if that is what it's generally called). Basically the first one is smaller (5 million rows) and the other is 40 million rows. I want to add the ...
babyface's user avatar
0 votes
1 answer
39 views

I want to lookup values from pivot, if value does not found then use N using Pandas Dataframe [duplicate]

Input df This is pivot I have.I want to lookup only zero value if there in above pivot and print N if value absent. Expected df In excel i am able to do comparison in these 2 df with sumif function ...
Sanju M's user avatar
  • 15
2 votes
2 answers
43 views

Merge Dataframe based on substring column labeld while keep the original columns label

I have a dataframe having columns with the a label pattern (name/startDateTime/endDateTime) import pandas as pd pd.DataFrame({ "[RATE] BOJ presser/2024-03-19T07:30:00Z/2024-03-19T10:30:00Z&...
Crovish's user avatar
  • 223
0 votes
2 answers
221 views

fill in null values of one pandas dataframe with another dataframe [duplicate]

I would like to fill in null values of one pandas dataframe with another dataframe (and multiple times, with multiple dataframes). Example: df_A A B C index 0 3 5....
lolo's user avatar
  • 79

15 30 50 per page
1
2 3 4 5
112