Well in the
.head()
case it
has to be a function because it takes an argument, of course, but in my mind,
head()
is an action---similar to the command line tool,
head -n 5 file
to get the first 5 lines of the file. So that is fitting a typical API that many programmers would already know. Instead of "its the first N values so it's stored so it should be an attribute" think of it as clipping the dataframe. —
alkasm 50 secs ago