Dataframe
Two-dimensional, size-mutable, potentially heterogeneous tabular data.
Attributes
The index (row labels) of the DataFrame.
The column labels of the DataFrame.
Conversion
Cast a pandas object to a specified dtype dtype
.
Make a copy of this object’s indices and data.
Indexing, iteration
Return the first n rows
Access a group of rows and columns by label(s) or a boolean array.
Purely integer-location based indexing for selection by position.
Return the last n rows.
Query the columns of a DataFrame with a boolean expression.
Binary operator functions
Get Addition of dataframe and other, element-wise (binary operator add).
Get Subtraction of dataframe and other, element-wise (binary operator sub).
Get Multiplication of dataframe and other, element-wise (binary operator mul).
Get Floating division of dataframe and other, element-wise (binary operator truediv).
Get Modulo of dataframe and other, element-wise (binary operator mod).
Get Exponential power of dataframe and other, element-wise (binary operator pow).
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
Apply a function along an axis of the DataFrame.
Group DataFrame using a mapper or by a Series of columns.
Map a function on Object along an axis to DataFrame
Computations / descriptive stats
Return a Series/DataFrame with absolute numeric value of each element.
Compute pairwise correlation of columns, excluding NA/null values.
Count non-NAN cells for each column or row.
Return cumulative maximum over a DataFrame or Series axis.
Return cumulative minimum over a DataFrame or Series axis.
Return cumulative product over a DataFrame or Series axis.
Return cumulative sum over a DataFrame or Series axis.
Generate descriptive statistics.
Return the maximum of the values for the requested axis.
Return the mean of the values for the requested axis.
Return the median of the values for the requested axis.
Return the minimum of the values for the requested axis.
Get the mode(s) of each element along the selected axis.
Round a DataFrame to a variable number of decimal places.
Return the sum of the values for the requested axis.
Return sample standard deviation over requested axis.
Return unbiased variance over requested axis.
Count distinct observations over requested axis.
Reindexing / selection / label manipulation
Drop specified labels from rows or columns.
Return the first n rows.
Alter axes labels.
Reset the index of a DataFrame
Return a random sample of items from an axis of object.
Set the DataFrame index using existing columns.
Return the last n rows.
Missing data handling
Remove missing values.
Fill NaN values with specified values
Detect missing values.
Replace values given in replace with value.
Sorting & transposing
Sort by the values along either axis.
Return transpose of DataFrame
Combining / comparing / joining / merging
Add new columns to a DataFrame.
Concatenate DataFrames together.
Merge DataFrame or named Series objects with a database-style join.
Plotting
Series.plot
is both a callable method and a namespace attribute for specific plotting methods of the form Series.plot.<kind>
.
Vertical bar plot.
Make a box plot of the DataFrame columns.
Make a violin plot of the DataFrame columns.
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.
Time series plots
Display Series as Interactive table in Div
Serialization / IO / conversion
Convert DataFrame to a CSV file.
Convert the object to a JSON.
[`DataFrame.toExcel`](../input-output/danfo.to\_excel.md)
Convert DataFrame to Excel file
Last updated