Giter Site home page Giter Site logo

Comments (4)

jmarintur avatar jmarintur commented on June 26, 2024 1

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.

rhshadrach avatar rhshadrach commented on June 26, 2024

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.

snoyes avatar snoyes commented on June 26, 2024

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.

jmarintur avatar jmarintur commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.