Skip to content

FutureWarning for .loc[list-of-labels] with missing labels provides wrong URL #19143

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

Closed
jschendel opened this issue Jan 9, 2018 · 0 comments · Fixed by #19145
Closed

FutureWarning for .loc[list-of-labels] with missing labels provides wrong URL #19143

jschendel opened this issue Jan 9, 2018 · 0 comments · Fixed by #19145
Labels
Docs Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jschendel
Copy link
Member

jschendel commented Jan 9, 2018

Code Sample, a copy-pastable example if possible

In [2]: s = pd.Series(['foo', 'bar', 'baz'])

In [3]: s.loc[[2,3]]
FutureWarning:
Passing list-likes to .loc or [] with any missing label will raise
KeyError in the future, you can use .reindex() as an alternative.

See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike
  if __name__ == '__main__':
Out[3]:
2    baz
3    NaN
dtype: object

Problem description

The URL in the deprecation warning has the wrong section name (#deprecate-loc-reindex-listlike), so the user isn't redirected to the relevant section.

Expected Output

I'd expect the URL to be link to have the correct section name (#indexing-deprecate-loc-reindex-listlike) or change the section name so it matches the link.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: 78147e9
python: 3.6.1.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.23.0.dev0+81.g78147e9
pytest: 3.1.2
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.13.3
scipy: 1.0.0
pyarrow: 0.6.0
xarray: 0.9.6
IPython: 6.1.0
sphinx: 1.5.6
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.4.2
numexpr: 2.6.4
feather: 0.4.0
matplotlib: 2.0.2
openpyxl: 2.4.8
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 0.9.8
lxml: 3.8.0
bs4: None
html5lib: 0.999
sqlalchemy: 1.1.13
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
fastparquet: 0.1.0
pandas_gbq: None
pandas_datareader: None

@jschendel jschendel changed the title Deprecation warning for .loc[list-of-labels] with missing labels provides wrong URL FutureWarning for .loc[list-of-labels] with missing labels provides wrong URL Jan 9, 2018
@jreback jreback added Docs Indexing Related to indexing on series/frames, not to indexes themselves labels Jan 9, 2018
@jreback jreback added this to the 0.23.0 milestone Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants