Home Forums Main Forums Python Forum What's the difference between df.describe() and df.describe???

  • What's the difference between df.describe() and df.describe???

     Datura updated 6 months, 1 week ago 1 Member · 1 Post
  • Datura

    Member
    December 9, 2020 at 10:07 pm
    Up
    1
    Down

    Ambeer asked a very good question, I would like to share it here with all.

    In Python, describe() is a method for data frame. A method is a local function confined to a specific object.

    Generally speaking, df.describe just points or connects to the object and method( it acts like a preparation before execution), but does NOT execute it. Instead, describe() will call and run the function, and return the execution results.

    Say we have a data frame called score, run below code, you will see that the y=score.describe is totally different from score.describe(). However, y() gives the same results as score.describe(). Interesting?

    score.describe()
    y=score.describe
    y
    y()

    Please see below reference:

    https://stackoverflow.com/<wbr>questions/31232770/deference-<wbr>between-df-describe-and-df-<wbr>describe

    Is it clear?

    • This discussion was modified 6 months, 1 week ago by  Datura.

Log in to reply.

Original Post
0 of 0 posts June 2018
Now