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???
-
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:
Is it clear?
- This discussion was modified 3 years, 10 months ago by Datura.
Log in to reply.