-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Broadcasting issue with 2d index in DataFrames #25416
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
Comments
I cannot reproduce under latest version 0.24.1: In [1]: import pandas as pd
In [2]: df1 = pd.DataFrame([[1]], columns = [[1]], index = [ 1, 2 ])
In [3]: df1
Out[3]:
1
1 1
2 1
In [4]: df2 = pd.DataFrame([[1]], columns = [[1]], index = [ [ 1, 2 ] ])
In [5]: df2
Out[5]:
1
1 1
2 1
In [6]: pd.__version__
Out[6]: u'0.24.1' Can you try the latest version? |
@Liam3851 : I can't reproduce either. We should add the example as a test to close this unless someone can reproduce on the latest releases. |
I can reproduce it. It was indeed failing on 0.23.4, but now working on 0.24.1. So indeed good to add a test for it. However, do we actually want to support 2D input as columns / index ? |
Added tests in #29083. ci is failing (for unrelated reasons). Will try to re-push later. |
It seems that if the index is just a list then broadcasting the values occurs. If it a list of lists, the index still maintains the same shape but broadcasting is not done in this case.
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: