DataFrame#
构造函数#
|
属性和底层数据#
坐标轴
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. |
转换#
|
Cast a pandas object to a specified dtype |
Detect missing values. |
|
Detect existing (non-missing) values. |
索引和迭代#
|
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. |
二元运算函数#
|
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). |
应用函数、分组和窗口#
|
Apply a function along an axis of the DataFrame. |
|
|
|
|
|
Call |
|
|
|
Provide rolling window calculations. |
|
Provide expanding transformations. |
|
Provide exponential weighted functions. |
计算和描述统计#
|
|
|
|
|
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. |
|
|
|
|
|
|
|
|
|
重设索引、选择和标签操作#
|
Prefix labels with string prefix. |
|
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. |
缺失值处理#
|
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. |
形状变换、排序和转置#
|
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. |
数据合并#
|
|
|
Assign new columns to a DataFrame. |
|
|
|
绘图#
DataFrame.plot
is both a callable method and a namespace attribute for
specific plotting methods of the form DataFrame.plot.<kind>
.
:py:class:`mars.dataframe.plotting.core.PlotAccessor`的别名 |
|
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. |
序列化、IO 和转换#
|
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. |