DataFrame#
Constructor#
|
Attributes and underlying data#
Axes
Return the dtypes in the DataFrame. |
|
|
Return a subset of the DataFrame's columns based on the column dtypes. |
Return an int representing the number of axes / array dimensions. |
|
|
Return the memory usage of each column in bytes. |
Conversion#
|
Cast a pandas object to a specified dtype |
Detect missing values. |
|
Detect existing (non-missing) values. |
Indexing, iteration#
|
Return the first n rows. |
Access a single value for a row/column label pair. |
|
|
Insert column into DataFrame at specified location. |
|
Iterate over DataFrame rows as (index, Series) pairs. |
|
Iterate over DataFrame rows as namedtuples. |
|
Replace values where the condition is True. |
|
Return item and drop from frame. |
|
Query the columns of a DataFrame with a boolean expression. |
|
Return the last n rows. |
|
Replace values where the condition is False. |
Binary operator functions#
|
Get Addition of dataframe and other, element-wise (binary operator add). |
|
Get Subtraction of dataframe and other, element-wise (binary operator subtract). |
|
Get Multiplication of dataframe and other, element-wise (binary operator mul). |
|
Get Floating division of dataframe and other, element-wise (binary operator truediv). |
|
Get Floating division of dataframe and other, element-wise (binary operator truediv). |
|
Get Integer division of dataframe and other, element-wise (binary operator floordiv). |
|
Get Modulo of dataframe and other, element-wise (binary operator mod). |
|
Get Exponential power of dataframe and other, element-wise (binary operator pow). |
|
Compute the matrix multiplication between the DataFrame and other. |
|
Get Addition of dataframe and other, element-wise (binary operator radd). |
|
Get Subtraction of dataframe and other, element-wise (binary operator rsubtract). |
|
Get Multiplication of dataframe and other, element-wise (binary operator rmul). |
|
Get Floating division of dataframe and other, element-wise (binary operator rtruediv). |
|
Get Floating division of dataframe and other, element-wise (binary operator rtruediv). |
|
Get Integer division of dataframe and other, element-wise (binary operator rfloordiv). |
|
Get Modulo of dataframe and other, element-wise (binary operator rmod). |
|
Get Exponential power of dataframe and other, element-wise (binary operator rpow). |
|
Get Less than of dataframe and other, element-wise (binary operator lt). |
|
Get Greater than of dataframe and other, element-wise (binary operator gt). |
|
Get Less than or equal to of dataframe and other, element-wise (binary operator le). |
|
Get Greater than or equal to of dataframe and other, element-wise (binary operator ge). |
|
Get Not equal to of dataframe and other, element-wise (binary operator ne). |
|
Get Equal to of dataframe and other, element-wise (binary operator eq). |
Function application, GroupBy & window#
|
Apply a function along an axis of the DataFrame. |
|
|
|
|
|
Call |
|
|
|
Provide rolling window calculations. |
|
Provide expanding transformations. |
|
Provide exponential weighted functions. |
Computations / descriptive stats#
|
|
|
|
|
Compute pairwise correlation of columns, excluding NA/null values. |
|
Compute pairwise correlation. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Evaluate a string describing operations on DataFrame columns. |
|
|
|
|
|
|
|
|
|
|
|
Count distinct observations over requested axis. |
|
Percentage change between the current and a prior element. |
|
|
|
|
|
Return values at the given quantile over requested axis. |
|
Round a DataFrame to a variable number of decimal places. |
|
|
|
|
|
|
|
|
|
Reindexing / selection / label manipulation#
|
Prefix labels with string prefix. |
|
Suffix labels with string suffix. |
|
Align two objects on their axes with the specified join method. |
|
Drop specified labels from rows or columns. |
|
Return DataFrame with duplicate rows removed. |
|
Return boolean Series denoting duplicate rows. |
|
Return the first n rows. |
|
Conform Series/DataFrame to new index with optional filling logic. |
|
Return an object with matching indices as other object. |
|
Alter axes labels. |
|
Set the name of the axis for the index or columns. |
|
Reset the index, or a level of it. |
|
Return a random sample of items from an axis of object. |
|
Assign desired index to given axis. |
|
|
|
Return the last n rows. |
Missing data handling#
|
Synonym for |
|
Synonym for |
|
Remove missing values. |
|
Synonym for |
|
Fill NA/NaN values using the specified method. |
Detect missing values. |
|
Detect missing values. |
|
Detect existing (non-missing) values. |
|
Detect existing (non-missing) values. |
|
|
Synonym for |
|
Replace values given in to_replace with value. |
Reshaping, sorting, transposing#
|
Transform each element of a list-like to a row, replicating index values. |
|
Unpivot a DataFrame from wide to long format, optionally leaving identifiers set. |
|
Sort by the values along either axis. |
|
Sort object by labels (along an axis). |
|
Stack the prescribed level(s) from columns to index. |
Transpose index and columns. |
Combining / joining / merging#
|
|
|
Assign new columns to a DataFrame. |
|
Join columns of another DataFrame. |
|
Merge DataFrame or named Series objects with a database-style join. |
Plotting#
DataFrame.plot
is both a callable method and a namespace attribute for
specific plotting methods of the form DataFrame.plot.<kind>
.
alias of |
|
Draw a stacked area plot. |
|
Vertical bar plot. |
|
Make a horizontal bar plot. |
|
Make a box plot of the DataFrame columns. |
|
Generate Kernel Density Estimate plot using Gaussian kernels. |
|
Generate a hexagonal binning plot. |
|
Draw one histogram of the DataFrame's columns. |
|
Generate Kernel Density Estimate plot using Gaussian kernels. |
|
Plot Series or DataFrame as lines. |
|
Generate a pie plot. |
|
Create a scatter plot with varying marker point size and color. |
Serialization / IO / conversion#
|
Write object to a comma-separated values (csv) file. |
|
Write a DataFrame to the binary parquet format, each chunk will be written to a Parquet file. |
|
Write records stored in a DataFrame to a SQL database. |
Misc#
|
Apply function to each chunk. |
|
Make Data more balanced across entire cluster. |