-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: undocumented head(n), tail(n) accept negative values. But not on GroupBy #30192
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
Subsequently found out this might be a duplicate of #9214, except its title and body don't make clear that it's suggesting the undocumented behavior is useful and should be documented. |
Happy to have this documented / implemented on groupby. Are you interested in working on it? |
This is marked as a docbug; I was mainly interested in documenting (both in docstring and pandas-docs) that this works on DataFrame, Series; I'm happy to do that if you can tell me how. Don't care much about implementing it on groupby. |
Seems that this was closed by #30556, feel free to reopen if you disagree |
DOC: undocumented behavior that works:
head(n)
,tail(n)
accept negative values both for DataFrame, Series. But not forGroupBy.head(n)
; doesn't correctly handle negative values.This is quite useful and could be documented.
head(-n)
returns all rows(/elements) other than the n first values. Similar todf[-6::]
.tail(-n)
returns all rows(/elements) other than the n last valuesCode Sample, a copy-pastable example if possible
Problem description
Add to documented behavior.
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.3.final.0
python-bits: 64
OS: Darwin
OS-release: 18.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.2
pytest: 5.2.4
pip: 19.3.1
setuptools: 41.6.0.post20191030
Cython: 0.29.14
numpy: 1.17.3
scipy: 1.3.1
pyarrow: None
xarray: None
IPython: 7.9.0
sphinx: 2.2.1
patsy: 0.5.1
dateutil: 2.8.1
pytz: 2019.3
blosc: None
bottleneck: 1.3.1
tables: 3.6.1
numexpr: 2.7.0
feather: None
matplotlib: 3.1.1
openpyxl: 3.0.1
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.2.6
lxml.etree: 4.4.1
bs4: 4.8.1
html5lib: 1.0.1
sqlalchemy: 1.3.11
pymysql: None
psycopg2: 2.8.4 (dt dec pq3 ext lo64)
jinja2: 2.10.3
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: