DataFrame

This is the main Pandas* data structure representing a table of rows and columns.

DataFrame is a two-dimensional structure with labeled axes. It can be thought of as a dictionary-like container for Series

Constructor

DataFrame

Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. The primary pandas data structure.

Attributes/Operators

DataFrame.index

The index (row labels) of the DataFrame.

DataFrame.columns

The column labels of the DataFrame.

Unsupported by Intel SDC.

DataFrame.dtypes

Return the dtypes in the DataFrame.

Unsupported by Intel SDC.

DataFrame.select_dtypes

Return a subset of the DataFrame’s columns based on the column dtypes.

Unsupported by Intel SDC.

DataFrame.values

Return a Numpy representation of the DataFrame.

DataFrame.axes

Return a list representing the axes of the DataFrame.

Unsupported by Intel SDC.

DataFrame.ndim

Return an int representing the number of axes / array dimensions.

Unsupported by Intel SDC.

DataFrame.size

Return an int representing the number of elements in this object.

Unsupported by Intel SDC.

DataFrame.shape

Return a tuple representing the dimensionality of the DataFrame.

Unsupported by Intel SDC.

DataFrame.memory_usage

Return the memory usage of each column in bytes.

Unsupported by Intel SDC.

DataFrame.empty

Indicator whether DataFrame is empty.

Unsupported by Intel SDC.

DataFrame.getitem

Get data from a DataFrame by indexer.

DataFrame.setitem

Set data to a DataFrame by indexer.

Type Conversions

DataFrame.astype

Cast a pandas object to a specified dtype dtype.

Unsupported by Intel SDC.

DataFrame.infer_objects

Attempt to infer better dtypes for object columns.

Unsupported by Intel SDC.

DataFrame.copy

Make a copy of this object’s indices and data.

DataFrame.isna

Detect missing values.

DataFrame.notna

Detect existing (non-missing) values.

Unsupported by Intel SDC.

DataFrame.bool

Return the bool of a single element PandasObject.

Unsupported by Intel SDC.

Indexing and Iteration

DataFrame.head

Return the first n rows.

DataFrame.at

Access a single value for a row/column label pair.

Unsupported by Intel SDC.

DataFrame.iat

Access a single value for a row/column pair by integer position.

DataFrame.loc

Access a group of rows and columns by label(s) or a boolean array.

Unsupported by Intel SDC.

DataFrame.iloc

Purely integer-location based indexing for selection by position.

Unsupported by Intel SDC.

DataFrame.insert

Insert column into DataFrame at specified location.

Unsupported by Intel SDC.

DataFrame.__iter__

Iterate over info axis.

Unsupported by Intel SDC.

DataFrame.items

Iterator over (column name, Series) pairs.

Unsupported by Intel SDC.

DataFrame.iteritems

Iterator over (column name, Series) pairs.

Unsupported by Intel SDC.

DataFrame.keys

Get the ‘info axis’ (see Indexing for more)

Unsupported by Intel SDC.

DataFrame.iterrows

Iterate over DataFrame rows as (index, Series) pairs.

Unsupported by Intel SDC.

DataFrame.itertuples

Iterate over DataFrame rows as namedtuples.

Unsupported by Intel SDC.

DataFrame.lookup

Label-based “fancy indexing” function for DataFrame.

Unsupported by Intel SDC.

DataFrame.pop

Return item and drop from frame. Raise KeyError if not found.

Unsupported by Intel SDC.

DataFrame.tail

Return the last n rows.

Unsupported by Intel SDC.

DataFrame.xs

Return cross-section from the Series/DataFrame.

Unsupported by Intel SDC.

DataFrame.get

Get item from object for given key (ex: DataFrame column).

Unsupported by Intel SDC.

DataFrame.isin

Whether each element in the DataFrame is contained in values.

Unsupported by Intel SDC.

DataFrame.where

Replace values where the condition is False.

Unsupported by Intel SDC.

DataFrame.mask

Replace values where the condition is True.

Unsupported by Intel SDC.

DataFrame.query

Query the columns of a DataFrame with a boolean expression.

Unsupported by Intel SDC.

For more information on .at, .iat, .loc, and .iloc, see the indexing documentation.

Binary Operator Functions

DataFrame.add

Get Addition of dataframe and other, element-wise (binary operator add).

Unsupported by Intel SDC.

DataFrame.sub

Get Subtraction of dataframe and other, element-wise (binary operator sub).

Unsupported by Intel SDC.

DataFrame.mul

Get Multiplication of dataframe and other, element-wise (binary operator mul).

Unsupported by Intel SDC.

DataFrame.div

Get Floating division of dataframe and other, element-wise (binary operator truediv).

Unsupported by Intel SDC.

DataFrame.truediv

Get Floating division of dataframe and other, element-wise (binary operator truediv).

Unsupported by Intel SDC.

DataFrame.floordiv

Get Integer division of dataframe and other, element-wise (binary operator floordiv).

Unsupported by Intel SDC.

DataFrame.mod

Get Modulo of dataframe and other, element-wise (binary operator mod).

Unsupported by Intel SDC.

DataFrame.pow

Get Exponential power of dataframe and other, element-wise (binary operator pow).

Unsupported by Intel SDC.

DataFrame.dot

Compute the matrix multiplication between the DataFrame and other.

Unsupported by Intel SDC.

DataFrame.radd

Get Addition of dataframe and other, element-wise (binary operator radd).

Unsupported by Intel SDC.

DataFrame.rsub

Get Subtraction of dataframe and other, element-wise (binary operator rsub).

Unsupported by Intel SDC.

DataFrame.rmul

Get Multiplication of dataframe and other, element-wise (binary operator rmul).

Unsupported by Intel SDC.

DataFrame.rdiv

Get Floating division of dataframe and other, element-wise (binary operator rtruediv).

Unsupported by Intel SDC.

DataFrame.rtruediv

Get Floating division of dataframe and other, element-wise (binary operator rtruediv).

Unsupported by Intel SDC.

DataFrame.rfloordiv

Get Integer division of dataframe and other, element-wise (binary operator rfloordiv).

Unsupported by Intel SDC.

DataFrame.rmod

Get Modulo of dataframe and other, element-wise (binary operator rmod).

Unsupported by Intel SDC.

DataFrame.rpow

Get Exponential power of dataframe and other, element-wise (binary operator rpow).

Unsupported by Intel SDC.

DataFrame.lt

Get Less than of dataframe and other, element-wise (binary operator lt).

Unsupported by Intel SDC.

DataFrame.gt

Get Greater than of dataframe and other, element-wise (binary operator gt).

Unsupported by Intel SDC.

DataFrame.le

Get Less than or equal to of dataframe and other, element-wise (binary operator le).

Unsupported by Intel SDC.

DataFrame.ge

Get Greater than or equal to of dataframe and other, element-wise (binary operator ge).

Unsupported by Intel SDC.

DataFrame.ne

Get Not equal to of dataframe and other, element-wise (binary operator ne).

Unsupported by Intel SDC.

DataFrame.eq

Get Equal to of dataframe and other, element-wise (binary operator eq).

Unsupported by Intel SDC.

DataFrame.combine

Perform column-wise combine with another DataFrame.

Unsupported by Intel SDC.

DataFrame.combine_first

Update null elements with value in the same location in other.

Unsupported by Intel SDC.

User-Defined Functions, GroupBy & Window

DataFrame.apply

Apply a function along an axis of the DataFrame.

Unsupported by Intel SDC.

DataFrame.applymap

Apply a function to a Dataframe elementwise.

Unsupported by Intel SDC.

DataFrame.pipe

Apply func(self, \*args, \*\*kwargs).

Unsupported by Intel SDC.

DataFrame.agg

Aggregate using one or more operations over the specified axis.

Unsupported by Intel SDC.

DataFrame.aggregate

Aggregate using one or more operations over the specified axis.

Unsupported by Intel SDC.

DataFrame.transform

Call func on self producing a DataFrame with transformed values and that has the same axis length as self.

Unsupported by Intel SDC.

DataFrame.groupby

Group DataFrame or Series using a mapper or by a Series of columns.

DataFrame.rolling

Provide rolling window calculations.

DataFrame.expanding

Provide expanding transformations.

Unsupported by Intel SDC.

DataFrame.ewm

Provide exponential weighted functions.

Unsupported by Intel SDC.

Computations, Descriptive Statistics

DataFrame.abs

Return a Series/DataFrame with absolute numeric value of each element.

Unsupported by Intel SDC.

DataFrame.all

Return whether all elements are True, potentially over an axis.

Unsupported by Intel SDC.

DataFrame.any

Return whether any element is True, potentially over an axis.

Unsupported by Intel SDC.

DataFrame.clip

Trim values at input threshold(s).

Unsupported by Intel SDC.

DataFrame.corr

Compute pairwise correlation of columns, excluding NA/null values.

Unsupported by Intel SDC.

DataFrame.corrwith

Compute pairwise correlation between rows or columns of DataFrame with rows or columns of Series or DataFrame. DataFrames are first aligned along both axes before computing the correlations.

Unsupported by Intel SDC.

DataFrame.count

Count non-NA cells for each column or row.

DataFrame.cov

Compute pairwise covariance of columns, excluding NA/null values.

Unsupported by Intel SDC.

DataFrame.cummax

Return cumulative maximum over a DataFrame or Series axis.

Unsupported by Intel SDC.

DataFrame.cummin

Return cumulative minimum over a DataFrame or Series axis.

Unsupported by Intel SDC.

DataFrame.cumprod

Return cumulative product over a DataFrame or Series axis.

Unsupported by Intel SDC.

DataFrame.cumsum

Return cumulative sum over a DataFrame or Series axis.

Unsupported by Intel SDC.

DataFrame.describe

Generate descriptive statistics that summarize the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.

Unsupported by Intel SDC.

DataFrame.diff

First discrete difference of element.

Unsupported by Intel SDC.

DataFrame.eval

Evaluate a string describing operations on DataFrame columns.

Unsupported by Intel SDC.

DataFrame.kurt

Return unbiased kurtosis over requested axis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1.

Unsupported by Intel SDC.

DataFrame.kurtosis

Return unbiased kurtosis over requested axis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0). Normalized by N-1.

Unsupported by Intel SDC.

DataFrame.mad

Return the mean absolute deviation of the values for the requested axis.

Unsupported by Intel SDC.

DataFrame.max

Return the maximum of the values for the requested axis.

DataFrame.mean

Return the mean of the values for the requested axis.

DataFrame.median

Return the median of the values for the requested axis.

DataFrame.min

Return the minimum of the values for the requested axis.

DataFrame.mode

Get the mode(s) of each element along the selected axis.

Unsupported by Intel SDC.

DataFrame.pct_change

Percentage change between the current and a prior element.

DataFrame.prod

Return the product of the values for the requested axis.

DataFrame.product

Return the product of the values for the requested axis.

Unsupported by Intel SDC.

DataFrame.quantile

Return values at the given quantile over requested axis.

Unsupported by Intel SDC.

DataFrame.rank

Compute numerical data ranks (1 through n) along axis.

Unsupported by Intel SDC.

DataFrame.round

Round a DataFrame to a variable number of decimal places.

Unsupported by Intel SDC.

DataFrame.sem

Return unbiased standard error of the mean over requested axis.

Unsupported by Intel SDC.

DataFrame.skew

Return unbiased skew over requested axis Normalized by N-1.

Unsupported by Intel SDC.

DataFrame.sum

Return the sum of the values for the requested axis.

DataFrame.std

Return sample standard deviation over requested axis.

DataFrame.var

Return unbiased variance over requested axis.

DataFrame.nunique

Count distinct observations over requested axis.

Unsupported by Intel SDC.

Re-Indexing, Selection, Label Manipulation

DataFrame.add_prefix

Prefix labels with string prefix.

Unsupported by Intel SDC.

DataFrame.add_suffix

Suffix labels with string suffix.

Unsupported by Intel SDC.

DataFrame.align

Align two objects on their axes with the specified join method for each axis Index.

Unsupported by Intel SDC.

DataFrame.at_time

Select values at particular time of day (e.g. 9:30AM).

Unsupported by Intel SDC.

DataFrame.between_time

Select values between particular times of the day (e.g., 9:00-9:30 AM).

Unsupported by Intel SDC.

DataFrame.drop

Drop specified labels from rows or columns.

DataFrame.drop_duplicates

Return DataFrame with duplicate rows removed, optionally only considering certain columns. Indexes, including time indexes are ignored.

Unsupported by Intel SDC.

DataFrame.duplicated

Return boolean Series denoting duplicate rows, optionally only considering certain columns.

Unsupported by Intel SDC.

DataFrame.equals

Test whether two objects contain the same elements.

Unsupported by Intel SDC.

DataFrame.filter

Subset rows or columns of dataframe according to labels in the specified index.

Unsupported by Intel SDC.

DataFrame.first

Convenience method for subsetting initial periods of time series data based on a date offset.

Unsupported by Intel SDC.

DataFrame.head

Return the first n rows.

DataFrame.idxmax

Return index of first occurrence of maximum over requested axis. NA/null values are excluded.

Unsupported by Intel SDC.

DataFrame.idxmin

Return index of first occurrence of minimum over requested axis. NA/null values are excluded.

Unsupported by Intel SDC.

DataFrame.last

Convenience method for subsetting final periods of time series data based on a date offset.

Unsupported by Intel SDC.

DataFrame.reindex

Conform DataFrame to new index with optional filling logic, placing NA/NaN in locations having no value in the previous index. A new object is produced unless the new index is equivalent to the current one and copy=False.

Unsupported by Intel SDC.

DataFrame.reindex_like

Return an object with matching indices as other object.

Unsupported by Intel SDC.

DataFrame.rename

Alter axes labels.

Unsupported by Intel SDC.

DataFrame.rename_axis

Set the name of the axis for the index or columns.

Unsupported by Intel SDC.

DataFrame.reset_index

Reset the index, or a level of it.

Unsupported by Intel SDC.

DataFrame.sample

Return a random sample of items from an axis of object.

Unsupported by Intel SDC.

DataFrame.set_axis

Assign desired index to given axis.

Unsupported by Intel SDC.

DataFrame.set_index

Set the DataFrame index using existing columns.

Unsupported by Intel SDC.

DataFrame.tail

Return the last n rows.

Unsupported by Intel SDC.

DataFrame.take

Return the elements in the given positional indices along an axis.

Unsupported by Intel SDC.

DataFrame.truncate

Truncate a Series or DataFrame before and after some index value.

Unsupported by Intel SDC.

Missing Data Handling

DataFrame.dropna

Remove missing values.

Unsupported by Intel SDC.

DataFrame.fillna

Fill NA/NaN values using the specified method.

Unsupported by Intel SDC.

DataFrame.replace

Replace values given in to_replace with value.

Unsupported by Intel SDC.

DataFrame.interpolate

Interpolate values according to different methods.

Unsupported by Intel SDC.

Re-Shaping, Sorting, Transposing

DataFrame.droplevel

Return DataFrame with requested index / column level(s) removed.

Unsupported by Intel SDC.

DataFrame.pivot

Return reshaped DataFrame organized by given index / column values.

Unsupported by Intel SDC.

DataFrame.pivot_table

Create a spreadsheet-style pivot table as a DataFrame. The levels in the pivot table will be stored in MultiIndex objects (hierarchical indexes) on the index and columns of the result DataFrame.

Unsupported by Intel SDC.

DataFrame.reorder_levels

Rearrange index levels using input order. May not drop or duplicate levels.

Unsupported by Intel SDC.

DataFrame.sort_values

Sort by the values along either axis.

Unsupported by Intel SDC.

DataFrame.sort_index

Sort object by labels (along an axis).

Unsupported by Intel SDC.

DataFrame.nlargest

Return the first n rows ordered by columns in descending order.

Unsupported by Intel SDC.

DataFrame.nsmallest

Return the first n rows ordered by columns in ascending order.

Unsupported by Intel SDC.

DataFrame.swaplevel

Swap levels i and j in a MultiIndex on a particular axis.

Unsupported by Intel SDC.

DataFrame.stack

Stack the prescribed level(s) from columns to index.

Unsupported by Intel SDC.

DataFrame.unstack

Pivot a level of the (necessarily hierarchical) index labels, returning a DataFrame having a new level of column labels whose inner-most level consists of the pivoted index labels.

Unsupported by Intel SDC.

DataFrame.swapaxes

Interchange axes and swap values axes appropriately.

Unsupported by Intel SDC.

DataFrame.melt

Unpivot a DataFrame from wide format to long format, optionally leaving identifier variables set.

Unsupported by Intel SDC.

DataFrame.explode

Transform each element of a list-like to a row, replicating the index values.

Unsupported by Intel SDC.

DataFrame.squeeze

Squeeze 1 dimensional axis objects into scalars.

Unsupported by Intel SDC.

DataFrame.to_xarray

Return an xarray object from the pandas object.

Unsupported by Intel SDC.

DataFrame.T

Transpose index and columns.

Unsupported by Intel SDC.

DataFrame.transpose

Transpose index and columns.

Unsupported by Intel SDC.

Combining, Joining, Merging

DataFrame.append

Append rows of other to the end of caller, returning a new object.

DataFrame.assign

Assign new columns to a DataFrame.

Unsupported by Intel SDC.

DataFrame.join

Join columns of another DataFrame.

Unsupported by Intel SDC.

DataFrame.merge

Merge DataFrame or named Series objects with a database-style join.

Unsupported by Intel SDC.

DataFrame.update

Modify in place using non-NA values from another DataFrame.

Unsupported by Intel SDC.

Time Series

DataFrame.asfreq

Convert TimeSeries to specified frequency.

Unsupported by Intel SDC.

DataFrame.asof

Return the last row(s) without any NaNs before where.

Unsupported by Intel SDC.

DataFrame.shift

Shift index by desired number of periods with an optional time freq.

Unsupported by Intel SDC.

DataFrame.slice_shift

Equivalent to shift without copying data. The shifted data will not include the dropped periods and the shifted axis will be smaller than the original.

Unsupported by Intel SDC.

DataFrame.tshift

Shift the time index, using the index’s frequency if available.

Unsupported by Intel SDC.

DataFrame.first_valid_index

Return index for first non-NA/null value.

Unsupported by Intel SDC.

DataFrame.last_valid_index

Return index for last non-NA/null value.

Unsupported by Intel SDC.

DataFrame.resample

Resample time-series data.

Unsupported by Intel SDC.

DataFrame.to_period

Convert DataFrame from DatetimeIndex to PeriodIndex with desired frequency (inferred from index if not passed).

Unsupported by Intel SDC.

DataFrame.to_timestamp

Cast to DatetimeIndex of timestamps, at beginning of period.

Unsupported by Intel SDC.

DataFrame.tz_convert

Convert tz-aware axis to target time zone.

Unsupported by Intel SDC.

DataFrame.tz_localize

Localize tz-naive index of a Series or DataFrame to target time zone.

Unsupported by Intel SDC.

Plotting

DataFrame.plot is both a callable method and a namespace attribute for specific plotting methods of the form DataFrame.plot.<kind>.

DataFrame.plot

Make plots of Series or DataFrame using the backend specified by the option plotting.backend. By default, matplotlib is used.

Unsupported by Intel SDC.

DataFrame.plot.area

Draw a stacked area plot.

Unsupported by Intel SDC.

DataFrame.plot.bar

Vertical bar plot.

Unsupported by Intel SDC.

DataFrame.plot.barh

Make a horizontal bar plot.

Unsupported by Intel SDC.

DataFrame.plot.box

Make a box plot of the DataFrame columns.

Unsupported by Intel SDC.

DataFrame.plot.density

Generate Kernel Density Estimate plot using Gaussian kernels.

Unsupported by Intel SDC.

DataFrame.plot.hexbin

Generate a hexagonal binning plot.

Unsupported by Intel SDC.

DataFrame.plot.hist

Draw one histogram of the DataFrame’s columns.

Unsupported by Intel SDC.

DataFrame.plot.kde

Generate Kernel Density Estimate plot using Gaussian kernels.

Unsupported by Intel SDC.

DataFrame.plot.line

Plot Series or DataFrame as lines.

Unsupported by Intel SDC.

DataFrame.plot.pie

Generate a pie plot.

Unsupported by Intel SDC.

DataFrame.plot.scatter

Create a scatter plot with varying marker point size and color.

Unsupported by Intel SDC.

DataFrame.boxplot

Make a box plot from DataFrame columns.

Unsupported by Intel SDC.

DataFrame.hist

Make a histogram of the DataFrame’s.

Unsupported by Intel SDC.

Sparse Accessor

Sparse-dtype specific methods and attributes are provided under the DataFrame.sparse accessor.

DataFrame.sparse.density

Ratio of non-sparse points to total (dense) data points represented in the DataFrame.

Unsupported by Intel SDC.

DataFrame.sparse.from_spmatrix

Create a new DataFrame from a scipy sparse matrix.

Unsupported by Intel SDC.

DataFrame.sparse.to_coo

Return the contents of the frame as a sparse SciPy COO matrix.

Unsupported by Intel SDC.

DataFrame.sparse.to_dense

Convert a DataFrame with sparse values to dense.

Unsupported by Intel SDC.

Serialization, Input-Output, Conversion

DataFrame.from_dict

Construct DataFrame from dict of array-like or dicts.

Unsupported by Intel SDC.

DataFrame.from_records

Convert structured or record ndarray to DataFrame.

Unsupported by Intel SDC.

DataFrame.info

Print a concise summary of a DataFrame.

Unsupported by Intel SDC.

DataFrame.to_parquet

Write a DataFrame to the binary parquet format.

Unsupported by Intel SDC.

DataFrame.to_pickle

Pickle (serialize) object to file.

Unsupported by Intel SDC.

DataFrame.to_csv

Write object to a comma-separated values (csv) file.

Unsupported by Intel SDC.

DataFrame.to_hdf

Write the contained data to an HDF5 file using HDFStore.

Unsupported by Intel SDC.

DataFrame.to_sql

Write records stored in a DataFrame to a SQL database.

Unsupported by Intel SDC.

DataFrame.to_dict

Convert the DataFrame to a dictionary.

Unsupported by Intel SDC.

DataFrame.to_excel

Write object to an Excel sheet.

Unsupported by Intel SDC.

DataFrame.to_json

Convert the object to a JSON string.

Unsupported by Intel SDC.

DataFrame.to_html

Render a DataFrame as an HTML table.

Unsupported by Intel SDC.

DataFrame.to_feather

Write out the binary feather-format for DataFrames.

Unsupported by Intel SDC.

DataFrame.to_latex

Render an object to a LaTeX tabular environment table.

Unsupported by Intel SDC.

DataFrame.to_stata

Export DataFrame object to Stata dta format.

Unsupported by Intel SDC.

DataFrame.to_msgpack

Serialize object to input file path using msgpack format.

Unsupported by Intel SDC.

DataFrame.to_gbq

Write a DataFrame to a Google BigQuery table.

Unsupported by Intel SDC.

DataFrame.to_records

Convert DataFrame to a NumPy record array.

Unsupported by Intel SDC.

DataFrame.to_string

Render a DataFrame to a console-friendly tabular output.

Unsupported by Intel SDC.

DataFrame.to_clipboard

Copy object to the system clipboard.

Unsupported by Intel SDC.

DataFrame.style

Property returning a Styler object containing methods for building a styled HTML representation fo the DataFrame.

Unsupported by Intel SDC.