Linked Questions

-1 votes
3 answers
100 views

python - combined 3 data frames, but need to realign data by values in 1 column [duplicate]

I have several data sources that i'm trying to work with - i asked a related question a couple of days ago (click here! so i have 3 dataframes each with a 'user_id' column that is common across all 3 ...
seuadr's user avatar
  • 143
1 vote
2 answers
72 views

I have 3 dataframes inside just one. How can I concat them? [duplicate]

I'm really stuck into this. I don't know how to make these 3 dataframes into one because they are inside an array or so. I really need your help. import numpy as np import pandas as pd import ...
Saulo Faria's user avatar
0 votes
1 answer
57 views

Merging Dataframes on Month, Or Unlike Column & Grouping [duplicate]

I have three dataframes I would like where I want to merge or join them based on the month column/field, then group by title. df1: Month Year TotalNumberofStreams TitleSortName 9 2018 ...
bigatData's user avatar
0 votes
0 answers
56 views

How can I iterate over pandas dataframes and concatenate on another dataframe [duplicate]

I have a few files that I've read into pandas dataframes that share the same values for the 0 column, but have differing values for the 1 column. How can I iterate over multiple dataframes, pull out ...
NaN's user avatar
  • 691
-2 votes
1 answer
43 views

I have a for loop that generates different pandas dataframes whose values I want to save sequentially [duplicate]

I made a for loop that creates a different pandas dataframe on each iteration. Something like this -> First iteration: index Letter Value 0 A 1 1 B 2 2 C 3 Second iteration: index Letter Value 0 C ...
Zehtre's user avatar
  • 3
947 votes
8 answers
465k views

Pandas Merging 101

How can I perform a (INNER| (LEFT|RIGHT|FULL) OUTER) JOIN with pandas? How do I add NaNs for missing rows after a merge? How do I get rid of NaNs after merging? Can I merge on the index? How do I ...
cs95's user avatar
  • 406k
202 votes
13 answers
534k views

How to merge multiple dataframes

I have different dataframes and need to merge them together based on the date column. If I only had two dataframes, I could use df1.merge(df2, on='date'), to do it with three dataframes, I use df1....
Vasco Ferreira's user avatar
244 votes
7 answers
188k views

NameError: name 'reduce' is not defined in Python

I'm using Python 3.2. Tried this: xor = lambda x,y: (x+y)%2 l = reduce(xor, [1,2,3,4]) And got the following error: l = reduce(xor, [1,2,3,4]) NameError: name 'reduce' is not defined Tried printing ...
Sergey's user avatar
  • 50.1k
15 votes
3 answers
50k views

Finding common elements between multiple dataframe columns

Hope you could help me. I am new to python and pandas, so please bear with me. I am trying to find the common word between three data frames and I am using Jupiter Notebook. Just for example: df1= A ...
Tikku's user avatar
  • 167
5 votes
2 answers
23k views

Merging two data frames based on the index column [duplicate]

I have two dataframes, I wanted to merge them into one single dataframe based on the matching row. My dataframe looks like this DF_1 Set_1 Fax_1 Fax_2 Abc_1 45 76 Abc_2 46 77 Abc_3 47 ...
ARJ's user avatar
  • 2,090
12 votes
1 answer
19k views

Several time series to DataFrame

I have problem merging several time series to a common DataFrame. The example code I'm using: import pandas import datetime import numpy as np start = datetime.datetime(2001, 1, 1) end = datetime....
Jonas's user avatar
  • 649
8 votes
2 answers
13k views

Create all possible combinations of multiple columns in a Pandas DataFrame

Given the below DataFrame, df = pd.DataFrame({'Student':['Siri','Alexa'], 'Class':['6', '7'], 'Section':['A','B'], 'Teacher':['Ravi','Mark'], 'School':['C','D']}) I would like to return a table with ...
Narendra Gadidasu's user avatar
5 votes
3 answers
10k views

Pandas: merge multiple dataframes and control column names?

I would like to merge nine Pandas dataframes together into a single dataframe, doing a join on two columns, controlling the column names. Is this possible? I have nine datasets. All of them have the ...
Richard's user avatar
  • 66.1k
3 votes
1 answer
8k views

efficiently merge multiple dataframes in pandas [duplicate]

What is the most efficient way to merge multiple data frames (i.e., more than 2) in pandas? There are a few answers: pandas joining multiple dataframes on columns Pandas left outer join multiple ...
Cmdt.Ed's user avatar
  • 41
1 vote
2 answers
16k views

ValueError: Indexes have overlapping values

I should join 2 pandas DataFrames with partially overlapping column names: Col1,Col2. The other columns do not overlap. I get the following error: ValueError: Indexes have overlapping values: Index(...
Fluxy's user avatar
  • 2,998

15 30 50 per page