Skip to main content

All Questions

Tagged with
0 votes
0 answers
14 views

merge rows based on first column and concatenate all other columns with comma delimiter [duplicate]

df0: CC AN 0 67562 EPC9999A 1 67562 EPC9999B 2 67994 EPXFXXXA 3 67995 EPXFXXXS Desired Result: ...
Kaizar's user avatar
  • 1
1 vote
1 answer
55 views

Join dataframes by a column with repeated values [duplicate]

There are two tables df1 and df2. df1 columns are id, predicted_date, df2 columns are id and actual_date. df1 = pd.DataFrame({ 'id': ['1', '1', '1', '2', '2', '2', '3', '3'], ...
Olyalya's user avatar
  • 25
1 vote
1 answer
44 views

Concat cells to merge names but if blank ignore

I have three columns of data: A B C 1 First Name Surname Preferred Name I would like the value in Column E to show First Name, Surname and Preferred Name in Brackets if there is one and no brackets ...
James Lyden's user avatar
1 vote
2 answers
113 views

Concatenate two dataframes with different headers

How can I concatenate 2 dataframes with headers of different length? I want to add the headers of the second dataframe as a row. Below is my df1: df1 = pd.DataFrame({'A': [1, 2], 'B': [2, 3], 'C': [3, ...
Jawed Sheikh's user avatar
0 votes
1 answer
37 views

How to concat a list of series according to earliest and latest dates

Hi I have a list of series called final_1 of more than 2000 items, each with thousands of rows, which i hope to concat into an entire dataframe with the index of the dataframe having the earliest and ...
oldradishsoip's user avatar
2 votes
1 answer
39 views

Append empty columns from a list to an existing dataframe

Consider this: I have a (rather long) list of column names: COLUMNS = [a, b, c, d] I have a df that have some columns as in the list, and some new ones: import pandas as pd data = {'a': [1, 2], ...
nzskra's user avatar
  • 175
1 vote
3 answers
48 views

Merging and concatinating simultaneously

I have multiple data frames, each representing monthly progress. My mission is to join them with two condition step by step. So here is three sample data frame, and I will try to explain what I want ...
PivotAl's user avatar
  • 79
-2 votes
1 answer
125 views

How to mergr/concat two dataframe with different column length? [duplicate]

I have a problem about merging or concatenating of two dataframes with different column length. Below two dataframes are having 3 same columns names and df2 has a another columns. a = [100, 66, 80] b =...
user23477807's user avatar
0 votes
1 answer
41 views

merging dataframe pandas different way

I have the following dataframes in pandas: df1 = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [5, 6, 7, 8]}) df2 = pd.DataFrame({'C': [1, 2, 2, 3, 3, 3, 4], 'D': [9, 10, 11, 12, 13, 14, 15]}) I would like ...
Roberto palmer's user avatar
0 votes
0 answers
21 views

How to merge two dataframes with different columns in r (R-studio)? [duplicate]

I have 2 large dataframes with different columns. The two dataframes could look like the small dataframes I have created below and named df1 and df2. > df1 casenumber income zipcode 1 1234-1234 ...
Chrisser_378's user avatar
0 votes
2 answers
361 views

Is there any equivalent of SAS merging in python?

I am converting SAS codes to python but I could not find any equivalent of this joining method in Python ? data have_a; input ID amount_a; datalines; 1 10 1 15 1 20 1 30 2 10 ; data have_b; input ...
bora bayrak's user avatar
0 votes
0 answers
6 views

how to combine single dataframe with multiple common columns

There is single dataframe in pandas and it has 22117 row and columns 47 but there is common column 13 how to combine these common column single dataframes . how can i solve these problem? it is a ...
md abu bakar chowdhury's user avatar
0 votes
1 answer
56 views

How to merge dictionary of dataframes on shared column [duplicate]

I have a dictionary of 7 dataframes of t-statistic values (for a different clinical site), where each dataframe has two columns of about 100 Brain ROIs and the t statistic value for that ROI. My goal ...
florence-y's user avatar
1 vote
2 answers
9k views

Combine multiple CSV files using merge while retaining filename information

Several questions have been asked and answered similar to mine, however they all used pd.concat, whereas I would like to use merge or something that could give me similar results. I would like to ...
Adriana's user avatar
  • 135
1 vote
1 answer
47 views

Concatenating two Pandas dataframes while keeping the values from the first one for repeated cells

I have two dataframes: df1= and df2= I want to concatenate the two dataframes at all rows and columns while the output has unique rows for the first two columns 'parameter' and 'date' and unique ...
python_beginner's user avatar

15 30 50 per page
1
2 3 4 5
33