-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Management of null values as index names #18988
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 think we only allow actual should also disallow a |
We could/should also do this for |
I would agree if I wasn't scared that some (weird) data becomes unloadable (just a generic fear, I don't have any example in mind).
Not following you here: you mean e.g. as argument to |
On this I'm skeptical, because if we have a |
Code Sample, a copy-pastable example if possible
Problem description
Strictly speaking, the above is not a bug in pandas, since
float('nan') != float('nan')
(butnp.nan is np.nan
): however, it is hardly useful/expected.None
is also a bad label to use in reference to a level, since it is not necessarily unique (see this comment ).So my suggestion is:
{None, np.nan, pd.NaT}
(Problems when accessing MultiIndex level with duplicated level names #18872 only allowsNone
)MultiIndex.get_level_values(.)
(or analogous) is called withNone
, ornp.nan
, orpd.NaT
.Expected Output
ValueError
from bothIn [3]:
andIn [4]:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: 10edfd0
python: 2.7.13.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.0-4-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: it_IT.UTF-8
LOCALE: None.None
pandas: 0.23.0.dev0+5.g10edfd06c
pytest: 3.2.1
pip: 9.0.1
setuptools: 33.1.1
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.18.1
pyarrow: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.9
patsy: 0.4.1+dev
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.1
feather: 0.3.1
matplotlib: 2.0.0
openpyxl: 2.3.0
xlrd: 1.0.0
xlwt: 0.7.5
xlsxwriter: 0.9.6
lxml: 3.7.1
bs4: 4.5.3
html5lib: 0.999999999
sqlalchemy: 1.0.15
pymysql: None
psycopg2: None
jinja2: 2.8
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: 0.2.1
The text was updated successfully, but these errors were encountered: