-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Emit warning for missing labels in Multiindex.loc[[...]] (and more) #20770
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
Changes from 8 commits
9ec8270
9291c89
2e93eef
46101ab
b4dbe37
44200f3
df9e8e2
d035b52
cc71fde
786e403
b936320
48fb72e
c62973b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -873,6 +873,7 @@ Deprecations | |
- The ``is_copy`` attribute is deprecated and will be removed in a future version (:issue:`18801`). | ||
- ``IntervalIndex.from_intervals`` is deprecated in favor of the :class:`IntervalIndex` constructor (:issue:`19263`) | ||
- ``DataFrame.from_items`` is deprecated. Use :func:`DataFrame.from_dict` instead, or ``DataFrame.from_dict(OrderedDict())`` if you wish to preserve the key order (:issue:`17320`, :issue:`17312`) | ||
- Indexing a ``MultiIndex`` or a ``FloatIndex`` with a list containing some missing keys will now show a ``FutureWarning``, consistently with other types of indexes (:issue:`17758`). | ||
|
||
- The ``broadcast`` parameter of ``.apply()`` is deprecated in favor of ``result_type='broadcast'`` (:issue:`18577`) | ||
- The ``reduce`` parameter of ``.apply()`` is deprecated in favor of ``result_type='reduce'`` (:issue:`18577`) | ||
|
@@ -1107,6 +1108,8 @@ Indexing | |
- :func:`Index.to_series` now accepts ``index`` and ``name`` kwargs (:issue:`18699`) | ||
- :func:`DatetimeIndex.to_series` now accepts ``index`` and ``name`` kwargs (:issue:`18699`) | ||
- Bug in indexing non-scalar value from ``Series`` having non-unique ``Index`` will return value flattened (:issue:`17610`) | ||
- Bug in indexing with iterator containing only missing keys, which raised no error (:issue:`20748`) | ||
- Fixed inconsistency in ``.ix`` between list and scalar keys when index has integer dtype and does not include desired key(s) (:issue:`20753`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... scalar keys when the index has an integer dtype and does not include the desired ... |
||
- Bug in ``__setitem__`` when indexing a :class:`DataFrame` with a 2-d boolean ndarray (:issue:`18582`) | ||
- Bug in ``str.extractall`` when there were no matches empty :class:`Index` was returned instead of appropriate :class:`MultiIndex` (:issue:`19034`) | ||
- Bug in :class:`IntervalIndex` where empty and purely NA data was constructed inconsistently depending on the construction method (:issue:`18421`) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4881,6 +4881,9 @@ def _ensure_index(index_like, copy=False): | |
if hasattr(index_like, 'name'): | ||
return Index(index_like, name=index_like.name, copy=copy) | ||
|
||
if is_iterator(index_like): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this covers generators as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
index_like = list(index_like) | ||
|
||
# must check for exactly list here because of strict type | ||
# check in clean_index_list | ||
if isinstance(index_like, list): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
:class:
for these