Python Forum
What is the difference between parenthesis and no parenthesis in head and tail?
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the difference between parenthesis and no parenthesis in head and tail?
#1
My first week using Python. I am a little confused about if I should use parenthesis or not when doing head and tail

Suppose I have variable df as a data frame in NumPy
df.head vs df.head() vs df.head(5) 
I understand the 5 means show first 5 rows, but how do I know if I should use df.head or df.head(), though df.head() gives me what I want.

But, why the following. This would be correct
df.column
This
df.column()
would give me an error message.

Why such inconsistency? I am so confused!
Reply


Messages In This Thread
What is the difference between parenthesis and no parenthesis in head and tail? - by kulimer - May-12-2017, 07:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  head() d8a988 4 2,668 Sep-03-2020, 09:08 AM
Last Post: buran
  pandas head() not reading all rows naab 0 1,819 Apr-07-2020, 01:06 PM
Last Post: naab

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020