DataFrame

A DataFrame is the primary object used by the Pandas module to store and manipulate data. It is a structured collection of data arranged in rows and columns, similar to a database table.

Many Pandas functions, such as .read_csv(), return DataFrame objects. Other functions take DataFrame objects and accept them as parameters. In addition, most of Pandas’ functionality is implemented through the DataFrame object. Methods and properties of the DataFrame object are listed below.

DataFrame

.drop()
Returns a DataFrame object with rows or columns removed based on column or index names.
.dropna()
Returns a DataFrame object with rows or columns with NA values removed.
.fillna()
Returns a DataFrame object with NA values replaced with the specified value.
.groupby()
Groups a DataFrame using a mapper or a series of columns and returns a GroupBy object.
.loc
Accesses specified rows and/or columns of a DataFrame object.
.replace()
Returns a DataFrame object after values within the DataFrame have been changed.

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Python:Pandas on Codecademy