Comments (4)
Hi @snoyes and @rhshadrach, I think the examples are quite self-explanatory, what about changing the first part to something like this:
This function exhibits the same behavior as df[:n]
, returning the first n
rows based on position. It is useful for quickly testing if your object has the right type of data in it.
When n
is positive, it returns the first n
rows. For n
equal to 0, it returns an empty object. For negative values of n
, it returns all rows except the last |n|
rows, mirroring the behavior of df[:n]
.
If n is larger...
from pandas.
Thanks for the report. I believe the intention here is to specifically highlight the behavior for negative values, which users might not consider, rather than to suggest this isn't the behavior for positive values.
Do you find this confusing?
from pandas.
It made me pause to wonder why it was only mentioned in the "negative values" section, worried that implies it does not behave that way for positive values and 0. I think the df[:n]
bit should appear in a separate paragraph, so it's clearly true for all n
.
from pandas.
Hi @rhshadrach, I've created this morning a PR to improve the definition. However, I see there are some unrelated issues that are preventing the branch to pass the checks. Is there anything I can do?
from pandas.
Related Issues (20)
- Reader accept directory path with suffix check HOT 5
- BUG: melt no longer supports id_vars and value_vars collapsing levels accross MultiIndex HOT 1
- BUG: interchange protocol with nullable pyarrow datatypes a non-null validity provides nonsense results HOT 3
- BUG: pyarrow stripping leading zeros with dtype=str HOT 5
- Potential regression induced by commit 6ef44f2 HOT 1
- BUG: List of years (as string) raises UserWarning with to_datetime HOT 3
- BUG: fastparquet interface fails on load with non-unique index and CoW HOT 3
- BUG: `join` with `list` does not behave like singleton
- BUG: pandas can't detect matplotlib on nanoserver (works fine on servercore) HOT 2
- BUG: Groupby ignores group_keys=False when followed by a rolling calculation HOT 4
- Breaking change in nightly wheels when assigning to `df.values`, no FutureWarning HOT 3
- BUILD: require `python-dateutil>=2.9.0` HOT 2
- BUG: Groupby followed by calculations like rolling, ewm, expanding should not duplicate the group keys index HOT 4
- ENH: Be able to set dtype before creating a new column HOT 4
- TST: Some Stata test datasets do not match the expected version
- Failing benchmarks - About 3000 asv benchmark tests fail out of 7545 HOT 8
- BUG: Error when exporting empty DataFrame with MultiIndex on both axes to xlsx file
- BUG: inconsisntent construction results between `pd.array` and `pd.Series` for dtype=str HOT 9
- BUG: Boxplot does not apply colors set by Matplotlib rcParams for certain plot elements HOT 2
- Potential regression induced by PR #57588 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas.