concept method in category pandas

appears as: method, methods, methods, method, The method, A method
Pandas in Action

This is an excerpt from Manning's book Pandas in Action.

Pandas can import a variety of file types include xlsx (Excel), sql (SQL), and hdf (Hierarchical Data Format). Each file type has its associated import method available at the top-level of the library. Think of a method as a command that we can issue, either to the library or an entity within it. For now, we'll use the read_csv method here to tell Pandas to open up the movies.csv file.

A method is an action or command sent to an object. It can be described as a function that belongs to an object, a procedure that acts upon a data structure. A method may manipulate an object's state by altering the values of one or more of its attributes. If we were modelling the same set of real-world objects in Python,

  • a Basketball object might have methods like throw, shoot, and pass
  • Like all objects, datetime objects have their own set of attributes and methods.

    In [156] da_vinci_birthday.year
    Out [156] 1452

    One example of a method on a datetime object is weekday, which returns the day of the week represented as an integer. 0 represents Sunday and 6 represents Saturday. It looks like Da Vinci was born on a Wednesday!