All Questions
Tagged with pandas inner-join
55
questions
0
votes
0
answers
35
views
Join 2 panda data frames consisting of different indexes - getting Nan
# combine yield changes and normalised surprises
eco_var_yields = pd.merge(norm_eco_surprise, yield__var, how = 'inner', on = 'date')
eco_var_yields_dates = pd.merge(eco_var_yields, ...
1
vote
1
answer
417
views
Can repeated joins be done more efficiently across many tables?
I have a problem which involves performing an inner join over multiple tables containing potentially tens of millions of rows. I'm aware that this ordinarily can't be optimized much more than a ...
0
votes
1
answer
81
views
Merging/joining multiple data frames on 2 common columns which are not one-to-one
Suppose I have multiple data frames (e.g. 10+) which all have 3 common columns, namely 'code', 'desc', and 'date'. They are of type int, str, and datetime respectively. I would like to inner join all ...
0
votes
0
answers
81
views
Pandas Inner Join results in a table larger than both the tables
From what I understand about inner join is that the resulting table should never have more rows than both tables. It should give the index that is common between both tables.
Dataframe has 79972 rows ...
0
votes
2
answers
44
views
Query error for ambiguous column name in SQLite
conn = sqlite3.connect(':memory:')
otvetili.to_sql('otvetili', conn, index=False)
init.to_sql('init', conn, index=False)
query = '''
select
t1.date,
t1.ABONENT,
...
-1
votes
3
answers
442
views
Inner join in pandas
I have two dataframes:
The first one was extracted from the manifest database.The data explains about the value, route (origin and destination), and also the actual SLA
awb_number route value ...
1
vote
1
answer
49
views
Python Pandas Merge/Join
This is a sample script for some basic testing that later should be implemented in PowerQuery/Python.
I'm not a Python developer so please be gentle.
import pandas as pd
data = [['Sql "syn-...
0
votes
0
answers
130
views
How to join/merge data tables based on close coordinates (using astropy or other methods)?
I have 2 astronomical tables, from a fits file and a csv file, that look something like this
ra, dec, val_a, val_b, ...
11.11, 22.22, 8, 9, ...
10.10, 20.20, 7, 6, ...
...
and this
ra, dec, val_x, ...
0
votes
1
answer
45
views
Joining the dataframe to its implicit column
Input table
input data frame
it contains four columns [ id , route , provider , zipcode ]
->id is the unique value
-> route is a driver location which gets updated over period of time and it ...
0
votes
1
answer
29
views
Python Pandas : joining selective columns from 1 data frame and add to another
I want to take 1 column from dataframe 'dfGS' and add it to dataframe 'df3'
If I just join the full dfGS to DF3 it works fine, but when I try to specify only 1 column to join I get : KeyError:'Ticker'*...
0
votes
1
answer
194
views
Pandas dataframe conditional inner join with itself
I am searching for a way to inner join a column of a dataframe with itself, based on a condition.
I have a large dataframe consisting of two colums, 'Group' and 'Person'. Now I would like to create a ...
-1
votes
1
answer
378
views
Opposite of left outer join in pandas based on one column results in less records than expected [duplicate]
I have the following two dataframes:
df2 has 2166 unique records.
I am trying to return the data in the blue area so I am using the following technique:
To get the green data I simply perform an ...
-1
votes
1
answer
293
views
Pandas-InnerJoin- Multiplication of Rows
I have two sets of data, with one common column. Some rows have repetitions so I created a similar small example.
Here are my dataframes:
#Dataframe1
import pandas as pd
data = [['tom', 10], ['tom', ...
0
votes
2
answers
4k
views
How to join two tables by one or another ID column (python pandas)?
I am using Python pandas, I would appreciate the code in Python. But you can suggest a solution in Excel or SQL. I have two tables A and B. Table A has two ID columns by which I want to join table B. ...
2
votes
2
answers
443
views
How to merge two dataframes with inner join, without having duplicate columns?
I have a dataframe like :
ItemName Category
item1 cat1
item2 cat1
item3 cat1
item4 cat1
item5 cat2
item6 cat2
and one like:
CategoryName Element
cat1 element1
cat2 ...