You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you elaborate what the bug is here exactly? TypeError: Index.name must be a hashable type makes sense, although it is confusing there is both a name and names argument (with the latter being removed in the future).
although it is confusing there is both a name and names argument (with the latter being removed in the future).
That's the point. With 1.2.5 and earlier, you could create a MultiIndex using pd.Index() and names= to specify the names. Since there was a decision to deprecate names, there isn't a path forward for people to create a MultiIndex using pd.Index() .
So we either do not deprecate names or we allow name to include multiple names when pd.Index() is used. We need to fix the inconsistency in the API.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
In pandas 1.2.5, you could create a
MultiIndex
usingpd.Index
with thenames
argument:With
names
being removed as an argument in the future, the user then has to be explicit about using thepd.MultiIndex()
constructor.See discussion with @jreback starting here: #35292 (comment)
Expected Behavior
Unclear. Should we accept
names
inpd.Index()
? Because you can create aMultiIndex
without names viaInstalled Versions
INSTALLED VERSIONS
commit : dace93d
python : 3.8.6.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.4.0.dev0+905.gdace93d694
numpy : 1.21.2
pytz : 2021.1
dateutil : 2.8.2
pip : 21.2.4
setuptools : 49.6.0.post20210108
Cython : 0.29.24
pytest : 6.2.5
hypothesis : 6.19.0
sphinx : 4.1.2
blosc : None
feather : None
xlsxwriter : 3.0.1
lxml.etree : 4.6.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.0.1
IPython : 7.27.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : 1.3.2
fsspec : 2021.05.0
fastparquet : 0.7.1
gcsfs : 2021.05.0
matplotlib : 3.4.2
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.7
pandas_gbq : None
pyarrow : 4.0.0
pyxlsb : 1.0.6
s3fs : 2021.05.0
scipy : 1.7.1
sqlalchemy : 1.4.23
tables : 3.6.1
tabulate : 0.8.9
xarray : 0.18.2
xlrd : 2.0.1
xlwt : 1.3.0
numba : 0.53.1
The text was updated successfully, but these errors were encountered: