Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error df1 must have all columns from join_columns #194

Closed
bukreevai opened this issue Apr 21, 2023 · 2 comments
Closed

Error df1 must have all columns from join_columns #194

bukreevai opened this issue Apr 21, 2023 · 2 comments
Assignees

Comments

@bukreevai
Copy link

I try compare two pandas dataframes

                comparer = datacompy.Compare(
                    source_df,
                    target_df,
                    join_columns=fields_list,  #You can also specify a list of columns
                    abs_tol=0.01, #Optional, defaults to 0
                    rel_tol=0, #Optional, defaults to 0
                    df1_name='SOURCE', #Optional, defaults to 'df1'
                    df2_name='TARGET' #Optional, defaults to 'df2'
                    )

head of my DFs:
df1:

     user_id  type currency  amount
0  133265969     1      EUR      10
1  133265975     1      EUR  695.99
2  133266265     1      EUR       0
3  133266266     4      USD   10000
4  133266267     1      EUR  274.24
5  133266268     1      EUR  274.24
6  133266269     4      USD   10000
7  133266270     1      GBP   99.99
8  133266271     1      EUR   99.99
9  133266272     1      GBP   99.99

df2:

     user_id  type currency  amount
0  133265969     4      EUR   10000
1  133265969     1      EUR      10
2  133265975     4      USD   10000
3  133265975     1      EUR  695.99
4  133266265     1      EUR       0
5  133266265     4      USD   10000
6  133266266     1      USD       0
7  133266266     4      USD   10000
8  133266267     4      USD   10000
9  133266267     1      EUR  274.24

dtypes of my DFs:
df1

user_id      int64
type         int64
currency    object
amount      object
dtype: object

df2:

user_id      int64
type         int64
currency    object
amount      object

And I has Error: df1 must have all columns from join_columns

What is it incorrect?

@fdosani
Copy link
Member

fdosani commented Apr 21, 2023

What is the value of fields_list?

@fdosani fdosani self-assigned this Apr 24, 2023
@fdosani
Copy link
Member

fdosani commented Jun 22, 2023

@bukreevai Feel free to reopen. I'm closing this for now since there hasn't been an update.

@fdosani fdosani closed this as completed Jun 22, 2023
@fdosani fdosani closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants