pandas API reference
3.1.1
Find out what pandas 3.1.1 functions and methods do, how to call them, and how to combine them in your own code.
On this page
Functions, methods, and attributes
Call a function from pandas, such as pd.to_numeric(). Call a method on an object, such as frame.head(). Read an attribute or property, such as frame.shape, without parentheses. In the reference, names start with pandas, and methods show the class they belong to.
import pandas as pd
frame = pd.DataFrame({"units": ["4", "7", "invalid"]})
units = pd.to_numeric(frame["units"], errors="coerce")
print(units.head(2).tolist())
print(frame.shape)
print(units.isna().sum())
[4.0, 7.0] (3, 1) 1
Data for the examples
Run this setup once in a notebook or Python session. The examples below use the same orders and teams tables. The three orders include one missing quantity so you can compare counting rows with counting usable values.
from io import StringIO
import pandas as pd
orders = pd.DataFrame({
"team": ["North", "North", "South"],
"day": pd.to_datetime(["2025-01-01", "2025-01-02", "2025-01-03"]),
"units": [4, None, 7],
})
teams = pd.DataFrame({
"team": ["North", "South"],
"region": ["A", "B"],
})
print(orders.groupby("team")["units"].agg(["size", "count", "sum"]).to_dict())
{'size': {'North': 2, 'South': 1}, 'count': {'North': 1, 'South': 1}, 'sum': {'North': 4.0, 'South': 7.0}}Find an API
Expand a group in the sidebar or search below for read_csv, groupby, or str.strip. Select a name to see its parameters and run its example.
1,794 of 1,794 entries
No API names match. Try a different search or category.
General functions (37)
-
Import data from an object that implements the dataframe interchange protocol.
Call syntax
api.interchange.from_dataframe(df[, allow_copy]) pandas.api.typing.Expressionclasspandas.bdate_rangefunctionBuild a DatetimeIndex of business days, optionally using a custom workweek and holidays.
Call syntax
pd.bdate_range([start, end, periods, freq, tz, ...])Example
pd.bdate_range("2025-01-03", periods=3)pandas.colfunctionCreate a deferred column expression for operations such as assign and loc.
Call syntax
pd.col(col_name)pandas.concatfunctionStack pandas objects along rows or place them side by side. Use axis=1 for columns and ignore_index=True to renumber the combined axis.
Call syntax
pd.concat(objs, *[, axis, join, ignore_index, ...])Example
pd.concat([orders.iloc[:2], orders.iloc[2:]], ignore_index=True)pandas.crosstabfunctionCount combinations of categories in a table. Supply values and aggfunc to calculate another summary.
Call syntax
pd.crosstab(index, columns[, values, rownames, ...])Example
pd.crosstab(orders["team"], orders["units"].notna())pandas.cutfunctionAssign numeric values to specified intervals or to a fixed number of equal-width bins.
Call syntax
pd.cut(x, bins[, right, labels, retbins, ...])Example
pd.cut(orders["units"], bins=[0, 5, 10], labels=["Small", "Large"])pandas.date_rangefunctionGenerate timestamps on a regular schedule and return a DatetimeIndex.
Call syntax
pd.date_range([start, end, periods, freq, tz, ...])Example
pd.date_range("2025-01-01", periods=3, freq="D")pandas.evalfunctionEvaluate a trusted expression over variables or table columns. A DataFrame call uses its columns as named inputs.
Call syntax
pd.eval(expr[, parser, engine, local_dict, ...])pandas.factorizefunctionEncode distinct values as integers and return the codes alongside the corresponding unique values.
Call syntax
pd.factorize(values[, sort, use_na_sentinel, ...])Example
pd.factorize(orders["team"])pandas.from_dummiesfunctionRebuild categorical columns from dummy indicator columns.
Call syntax
pd.from_dummies(data[, sep, default_category])pandas.get_dummiesfunctionExpand categorical values into indicator columns, one per category.
Call syntax
pd.get_dummies(data[, prefix, prefix_sep, ...])Example
pd.get_dummies(orders["team"], prefix="team")pandas.infer_freqfunctionInfer a regular frequency from dates or timedeltas when the observations permit it.
Call syntax
pd.infer_freq(index)pandas.interval_rangefunctionConstruct an IntervalIndex with evenly spaced boundaries.
Call syntax
pd.interval_range([start, end, periods, freq, ...])Example
pd.interval_range(start=0, end=10, periods=2)-
Write the configured Stata data file, including its data and metadata.
Call syntax
StataWriter.write_file() pandas.isnafunctionIdentify missing values. The result is a boolean for a scalar and a boolean mask for an array-like input.
Call syntax
pd.isna(obj)Example
pd.isna(orders["units"])pandas.isnullfunctionUse isna to identify missing values.
Call syntax
pd.isnull(obj)pandas.lreshapefunctionMove groups of equally sized wide columns into aligned long-form columns.
Call syntax
pd.lreshape(data, groups[, dropna])pandas.meltfunctionKeep identifier columns and turn measured columns into variable–value rows.
Call syntax
pd.melt(frame[, id_vars, value_vars, var_name, ...])Example
pd.melt(orders, id_vars="team", value_vars=["units"])pandas.mergefunctionJoin tables by matching keys. Set how for the join type and validate to check the expected key relationship.
Call syntax
pd.merge(left, right[, how, on, left_on, ...])Example
pd.merge(orders, teams, on="team", how="left", validate="many_to_one")pandas.merge_asoffunctionMatch each ordered key to a nearby key in the other table. Sort the keys first and use direction or tolerance to control the match.
Call syntax
pd.merge_asof(left, right[, on, left_on, ...])pandas.merge_orderedfunctionJoin ordered data such as time series, with optional forward-filling across the merged sequence.
Call syntax
pd.merge_ordered(left, right[, on, left_on, ...])pandas.notnafunctionIdentify present values by inverting the isna result.
Call syntax
pd.notna(obj)Example
pd.notna(orders["units"])pandas.notnullfunctionUse notna to identify present values.
Call syntax
pd.notnull(obj)pandas.period_rangefunctionGenerate consecutive periods such as months or quarters and return a PeriodIndex.
Call syntax
pd.period_range([start, end, periods, freq, name])Example
pd.period_range("2025-01", periods=3, freq="M")pandas.pivotfunctionMove distinct values into columns. Each output row–column pair needs a single source value.
Call syntax
pd.pivot(data, *, columns[, index, values])Example
pd.pivot(orders, index="day", columns="team", values="units")pandas.pivot_tablefunctionGroup rows and columns into a summary table. Use aggfunc to control how repeated combinations are reduced.
Call syntax
pd.pivot_table(data[, values, index, columns, ...])Example
pd.pivot_table(orders, index="team", values="units", aggfunc="sum")pandas.qcutfunctionMake bins based on quantiles so bins have approximately equal numbers of observations.
Call syntax
pd.qcut(x, q[, labels, retbins, precision, ...])Example
pd.qcut(pd.Series([10, 20, 30, 40]), q=2)pandas.timedelta_rangefunctionBuild a TimedeltaIndex at fixed increments between specified boundaries.
Call syntax
pd.timedelta_range([start, end, periods, freq, ...])Example
pd.timedelta_range("0h", periods=3, freq="1h")pandas.to_datetimefunctionParse input as datetimes. Use format for a known layout, utc=True to normalize to UTC and errors="coerce" to mark invalid values as NaT.
Call syntax
pd.to_datetime(arg[, errors, dayfirst, ...])Example
pd.to_datetime(["2025-01-01", "invalid"], format="%Y-%m-%d", errors="coerce")pandas.to_numericfunctionParse input as numbers. Use errors="coerce" for invalid input and downcast when a smaller numeric dtype is suitable.
Call syntax
pd.to_numeric(arg[, errors, downcast, ...])Example
pd.to_numeric(pd.Series(["4", "invalid"]), errors="coerce")pandas.to_timedeltafunctionParse durations into timedelta values. Specify unit for numeric durations.
Call syntax
pd.to_timedelta(arg[, unit, errors])Example
pd.to_timedelta([15, 30], unit="min")-
Try to infer a strptime-style format string from one date string.
Call syntax
tseries.api.guess_datetime_format(dt_str[, ...]) pandas.uniquefunctionGet distinct values in encounter order without sorting.
Call syntax
pd.unique(values)Example
pd.unique(orders["team"])pandas.util.hash_arrayfunctionCompute a 64-bit hash for each element of a one-dimensional array.
Call syntax
util.hash_array(vals[, encoding, hash_key, ...])pandas.util.hash_pandas_objectfunctionCompute element-wise hashes, optionally incorporating the pandas object's index.
Call syntax
util.hash_pandas_object(obj[, index, ...])pandas.wide_to_longfunctionTurn column families such as sales_2025 and sales_2026 into rows using shared prefixes and changing suffixes.
Call syntax
pd.wide_to_long(df, stubnames, i, j[, sep, suffix])
Input and output (59)
pandas.api.typing.JsonReaderclass-
Write records to an Apache Iceberg table through an Iceberg catalog.
Call syntax
DataFrame.to_iceberg(table_identifier[, ...]) pandas.DataFrame.to_xmlmethodSerialize DataFrame rows and fields as an XML document.
Call syntax
DataFrame.to_xml([path_or_buffer, index, ...])pandas.ExcelFileclasspandas.ExcelFile.bookpropertypandas.ExcelFile.parsemethodRead worksheets from an open ExcelFile. This method is deprecated in pandas 3.1.1. Use read_excel with the open workbook instead.
Call syntax
ExcelFile.parse([sheet_name, header, names, ...])pandas.ExcelFile.sheet_namespropertypandas.ExcelWriterclasspandas.HDFStore.appendmethodAdd rows to an HDFStore table without replacing existing rows.
Call syntax
HDFStore.append(key, value[, format, axes, ...])-
Split columns between related HDF tables and append the new rows to them.
Call syntax
HDFStore.append_to_multiple(d, value, selector) pandas.HDFStore.copymethodCopy stored pandas objects to another HDF5 file, optionally selecting keys.
Call syntax
HDFStore.copy(file[, mode, propindexes, ...])-
Build a PyTables index on stored columns for indexed queries.
Call syntax
HDFStore.create_table_index(key[, columns, ...]) pandas.HDFStore.flushmethodSend pending HDFStore writes to disk.
Call syntax
HDFStore.flush([fsync])pandas.HDFStore.getmethodRetrieve an object by key. A Series or DataFrame can also return a supplied default for an unknown key.
Call syntax
HDFStore.get(key)-
Access the HDFStore storer that manages the object at a given key.
Call syntax
HDFStore.get_storer(key) pandas.HDFStore.groupsmethodList the top-level nodes in an HDFStore.
Call syntax
HDFStore.groups()pandas.HDFStore.infomethodReport the path and stored objects described by the HDFStore.
Call syntax
HDFStore.info()pandas.HDFStore.is_openpropertypandas.HDFStore.keysmethodList stored object keys, including their HDF group paths.
Call syntax
HDFStore.keys([include])pandas.HDFStore.putmethodSave a pandas object at a key in an HDFStore, replacing any existing value there.
Call syntax
HDFStore.put(key, value[, format, index, ...])pandas.HDFStore.removemethodDelete an HDFStore object or remove rows that meet the supplied condition.
Call syntax
HDFStore.remove(key[, where, start, stop])pandas.HDFStore.selectmethodRead an HDFStore table or object. For tables, supply where to restrict rows.
Call syntax
HDFStore.select(key[, where, start, stop, ...])-
Get the row positions selected by an HDFStore table query.
Call syntax
HDFStore.select_as_coordinates(key[, where, ...]) -
Read and combine columns from several HDFStore tables that share corresponding rows.
Call syntax
HDFStore.select_as_multiple(keys[, where, ...]) -
Read a single column from a stored HDF table.
Call syntax
HDFStore.select_column(key, column[, start, ...]) pandas.HDFStore.walkmethodIterate through the groups in an HDF file to discover stored pandas objects.
Call syntax
HDFStore.walk([where])-
Write the receiver to an Excel sheet. Use ExcelWriter to manage multiple sheets in one workbook.
Call syntax
Styler.to_excel(excel_writer[, sheet_name, ...]) -
Render the receiver as an HTML table. A Styler includes applicable styling rules in its output.
Call syntax
Styler.to_html([buf, table_uuid, ...]) -
Produce a LaTeX table representation of the receiver.
Call syntax
Styler.to_latex([buf, column_format, ...]) -
Build a JSON Table Schema descriptor from a DataFrame or Series.
Call syntax
build_table_schema(data[, index, ...]) pandas.io.parsers.readers.TextFileReaderclasspandas.io.parsers.TextFileReaderclass-
Release the parser and its file handle. Other readers and writers release their associated resources.
Call syntax
TextFileReader.close() -
Read the next batch from a TextFileReader, optionally overriding the configured chunk size.
Call syntax
TextFileReader.get_chunk([size]) -
Read the next requested number of rows from the TextFileReader into a DataFrame.
Call syntax
TextFileReader.read([nrows]) pandas.io.stata.StataReader.data_labelproperty-
Map each Stata value-label set to its code-to-label mapping.
Call syntax
StataReader.value_labels() -
Map Stata column names to their descriptive labels.
Call syntax
StataReader.variable_labels() pandas.json_normalizefunctionFlatten nested JSON-like records into columns. Set record_path to choose a nested list of records.
Call syntax
pd.json_normalize(data[, record_path, meta, ...])Example
pd.json_normalize([{"id": 1, "location": {"city": "Yangon"}}])pandas.read_clipboardfunctionParse delimited text from the system clipboard into a DataFrame.
Call syntax
pd.read_clipboard([sep, dtype_backend])pandas.read_csvfunctionParse delimited text into a DataFrame. Use dtype for identifier columns and usecols or chunksize to limit the data read.
Call syntax
pd.read_csv(filepath_or_buffer, *[, sep, ...])Example
pd.read_csv(StringIO("id,units\n001,4\n"), dtype={"id": "string"})pandas.read_excelfunctionRead a worksheet or multiple worksheets. Use sheet_name to choose sheets and header to identify column labels.
Call syntax
pd.read_excel(io[, sheet_name, header, names, ...])pandas.read_featherfunctionRead a Feather file into a DataFrame, optionally selecting a subset of its columns.
Call syntax
pd.read_feather(path[, columns, use_threads, ...])pandas.read_fwffunctionParse columns whose positions are fixed within each text line.
Call syntax
pd.read_fwf(filepath_or_buffer, *[, colspecs, ...])pandas.read_hdffunctionLoad an object by key from HDF5, with row filtering available for table-format data.
Call syntax
pd.read_hdf(path_or_buf[, key, mode, errors, ...])pandas.read_htmlfunctionExtract matching HTML tables and return a list of DataFrames.
Call syntax
pd.read_html(io, *[, match, flavor, header, ...])pandas.read_icebergfunctionLoad table data through an Apache Iceberg catalog.
Call syntax
pd.read_iceberg(table_identifier[, ...])pandas.read_jsonfunctionRead a JSON file or stream. Set orient for the record layout and lines=True for newline-delimited records.
Call syntax
pd.read_json(path_or_buf, *[, orient, typ, ...])pandas.read_orcfunctionLoad an ORC file into a DataFrame, with optional column selection.
Call syntax
pd.read_orc(path[, columns, dtype_backend, ...])pandas.read_parquetfunctionLoad a Parquet file or dataset. Use columns to read selected columns and filters where supported to reduce the rows scanned.
Call syntax
pd.read_parquet(path[, engine, columns, ...])pandas.read_picklefunctionRestore a pickled Python object, such as a DataFrame. Load pickle files only from trusted sources.
Call syntax
pd.read_pickle(filepath_or_buffer[, ...])pandas.read_sasfunctionLoad data from a SAS XPORT or SAS7BDAT file.
Call syntax
pd.read_sas(filepath_or_buffer, *[, format, ...])pandas.read_spssfunctionLoad a DataFrame from an SPSS data file.
Call syntax
pd.read_spss(path[, usecols, ...])pandas.read_sqlfunctionLoad a database table or SQL query result as a DataFrame.
Call syntax
pd.read_sql(sql, con[, index_col, ...])pandas.read_sql_queryfunctionExecute a SELECT query and load its result. Supply query values through params.
Call syntax
pd.read_sql_query(sql, con[, index_col, ...])pandas.read_sql_tablefunctionLoad columns from a named SQL database table.
Call syntax
pd.read_sql_table(table_name, con[, schema, ...])pandas.read_statafunctionLoad Stata data and optionally decode labeled values into categories.
Call syntax
pd.read_stata(filepath_or_buffer, *[, ...])pandas.read_tablefunctionRead delimited text into a DataFrame. The default delimiter is a tab.
Call syntax
pd.read_table(filepath_or_buffer, *[, sep, ...])pandas.read_xmlfunctionTurn elements selected from XML into DataFrame rows and columns.
Call syntax
pd.read_xml(path_or_buffer, *[, xpath, ...])
DataFrame (219)
pandas.DataFrameclasspandas.DataFrame.__add__methodImplement + for the receiver, including its label alignment or offset rules.
Call syntax
DataFrame.__add__(other)-
Expose tabular data through the dataframe interchange protocol.
Call syntax
DataFrame.__dataframe__([nan_as_null, ...]) -
Implement ~ for the receiver. For a boolean mask, flip true and false.
Call syntax
DataFrame.__invert__() -
Support iteration, yielding columns for a DataFrame or key–object pairs for GroupBy.
Call syntax
DataFrame.__iter__() pandas.DataFrame.absmethodTake the absolute value of each numeric element.
Call syntax
DataFrame.abs()pandas.DataFrame.addmethodAdd corresponding values. Labeled pandas operands align by their labels.
Call syntax
DataFrame.add(other[, axis, level, fill_value])-
Prepend text to labels on the chosen axis.
Call syntax
DataFrame.add_prefix(prefix[, axis]) -
Append text to labels on the chosen axis.
Call syntax
DataFrame.add_suffix(suffix[, axis]) pandas.DataFrame.aggmethodSummarize values with named operations or callables. The result shape depends on the operations and object.
Call syntax
DataFrame.agg([func, axis])-
Summarize values with one or more operations using the same interface as agg.
Call syntax
DataFrame.aggregate([func, axis]) pandas.DataFrame.alignmethodReturn two objects with compatible labels. Set join to choose which labels to retain.
Call syntax
DataFrame.align(other[, join, axis, level, ...])pandas.DataFrame.allmethodTest whether every value along the selected axis or group evaluates to true.
Call syntax
DataFrame.all(*[, axis, bool_only, skipna])pandas.DataFrame.anymethodTest whether at least one value along the selected axis or group evaluates to true.
Call syntax
DataFrame.any(*[, axis, bool_only, skipna])pandas.DataFrame.applymethodApply a callable to one column at a time by default, or one row at a time with axis=1.
Call syntax
DataFrame.apply(func[, axis, raw, ...])pandas.DataFrame.asfreqmethodConform the object to a frequency. Use resample to aggregate observations into time bins.
Call syntax
DataFrame.asfreq(freq[, method, how, ...])pandas.DataFrame.asofmethodLook up the last usable observation at or before the requested label.
Call syntax
DataFrame.asof(where[, subset])pandas.DataFrame.assignmethodBuild a new DataFrame with added or replaced columns. Callables can use columns assigned earlier in the same call.
Call syntax
DataFrame.assign(**kwargs)Example
orders.assign(double_units=lambda frame: frame["units"] * 2)pandas.DataFrame.astypemethodConvert to another dtype. A DataFrame accepts a mapping to choose conversions column by column.
Call syntax
DataFrame.astype(dtype[, copy, errors])Example
orders.astype({"units": "Float64"})pandas.DataFrame.atpropertyRead or set a single value using its row and column labels.
pandas.DataFrame.at_timemethodSelect observations at one clock time from a datetime-indexed object.
Call syntax
DataFrame.at_time(time[, asof, axis])pandas.DataFrame.attrspropertypandas.DataFrame.axesproperty-
Select observations within a clock-time range, independent of their calendar dates.
Call syntax
DataFrame.between_time(start_time, end_time) pandas.DataFrame.bfillmethodFill a gap using the next available value along the selected direction.
Call syntax
DataFrame.bfill(*[, axis, inplace, limit, ...])pandas.DataFrame.boxplotmethodDraw box plots to compare medians, spread and possible outliers.
Call syntax
DataFrame.boxplot([column, by, ax, ...])pandas.DataFrame.clipmethodClamp values to lower or upper limits, leaving values within the limits unchanged.
Call syntax
DataFrame.clip([lower, upper, axis, inplace])Example
orders[["units"]].clip(upper=5)pandas.DataFrame.columnsattributeGet the Index containing column labels.
pandas.DataFrame.combinemethodCombine aligned objects using a callable. DataFrame passes columns to the callable and Series passes individual values.
Call syntax
DataFrame.combine(other, func[, fill_value, ...])-
Fill missing positions from a second aligned object while keeping existing valid values.
Call syntax
DataFrame.combine_first(other) pandas.DataFrame.comparemethodDisplay the differences between two equally labeled objects side by side.
Call syntax
DataFrame.compare(other[, align_axis, ...])-
Infer dtypes with support for missing values, such as nullable integers or strings.
Call syntax
DataFrame.convert_dtypes([infer_objects, ...]) pandas.DataFrame.copymethodMake a copy of the receiver. For an HDFStore, copy stored data to a different file.
Call syntax
DataFrame.copy([deep])pandas.DataFrame.corrmethodCalculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
DataFrame.corr([method, min_periods, ...])-
Calculate correlations with corresponding rows or columns of another object.
Call syntax
DataFrame.corrwith(other[, axis, drop, ...]) pandas.DataFrame.countmethodCount nonmissing values along the selected axis or within each group or window.
Call syntax
DataFrame.count([axis, numeric_only])pandas.DataFrame.covmethodEstimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
DataFrame.cov([min_periods, ddof, numeric_only])pandas.DataFrame.cummaxmethodTrack the largest value encountered up to each position.
Call syntax
DataFrame.cummax([axis, skipna, numeric_only])pandas.DataFrame.cumminmethodTrack the smallest value encountered up to each position.
Call syntax
DataFrame.cummin([axis, skipna, numeric_only])pandas.DataFrame.cumprodmethodKeep a running product in observation order.
Call syntax
DataFrame.cumprod([axis, skipna, numeric_only])pandas.DataFrame.cumsummethodKeep a running total in observation order.
Call syntax
DataFrame.cumsum([axis, skipna, numeric_only])-
Summarize values with statistics appropriate to their dtype, such as quartiles for numbers or frequencies for categories.
Call syntax
DataFrame.describe([percentiles, include, ...])Example
orders[["units"]].describe() pandas.DataFrame.diffmethodSubtract an earlier observation from the current one. Change periods to adjust the distance.
Call syntax
DataFrame.diff([periods, axis])pandas.DataFrame.divmethodDivide corresponding values with true division, preserving fractional quotients.
Call syntax
DataFrame.div(other[, axis, level, fill_value])pandas.DataFrame.dotmethodCompute a dot product or matrix multiplication, aligning shared labels where applicable.
Call syntax
DataFrame.dot(other)pandas.DataFrame.dropmethodRemove rows or columns by label. Specify columns= to make column removal explicit.
Call syntax
DataFrame.drop([labels, axis, index, ...])Example
orders.drop(columns="day")-
Keep one occurrence of duplicate values or rows by default. Use keep to choose which occurrences survive.
Call syntax
DataFrame.drop_duplicates([subset, keep, ...])Example
orders.drop_duplicates(subset=["team"]) -
Remove one or more levels of a hierarchical index.
Call syntax
DataFrame.droplevel(level[, axis]) pandas.DataFrame.dropnamethodDrop entries with missing values. For DataFrames, subset restricts the columns considered when dropping rows.
Call syntax
DataFrame.dropna(*[, axis, how, thresh, ...])Example
orders.dropna(subset=["units"])pandas.DataFrame.dtypespropertyInspect the dtype of each column in a Series indexed by column name.
Example
orders.dtypes-
Mark repeated values or rows with a boolean mask. Use keep=False to mark every member of a duplicate set.
Call syntax
DataFrame.duplicated([subset, keep])Example
orders.duplicated(subset=["team"]) pandas.DataFrame.emptypropertyCheck whether at least one axis has length zero. A table filled with missing values can still have rows and columns.
pandas.DataFrame.eqmethodCompare corresponding values for equality after any applicable label alignment.
Call syntax
DataFrame.eq(other[, axis, level])pandas.DataFrame.equalsmethodCheck whether two objects have compatible shapes and the same contents, including missing values in the same locations.
Call syntax
DataFrame.equals(other)pandas.DataFrame.evalmethodEvaluate a trusted expression over variables or table columns. A DataFrame call uses its columns as named inputs.
Call syntax
DataFrame.eval(expr, *[, inplace])pandas.DataFrame.ewmmethodBuild an exponentially weighted window for calculations that emphasize recent observations.
Call syntax
DataFrame.ewm([com, span, halflife, alpha, ...])-
Build a window that grows from the start through each observation.
Call syntax
DataFrame.expanding([min_periods, method]) pandas.DataFrame.explodemethodExpand list-like cells into rows, repeating original row labels as needed.
Call syntax
DataFrame.explode(column[, ignore_index])pandas.DataFrame.ffillmethodFill gaps with the most recent available value in the selected direction.
Call syntax
DataFrame.ffill(*[, axis, inplace, limit, ...])pandas.DataFrame.fillnamethodReplace missing values with supplied replacements, such as a scalar or values aligned by label.
Call syntax
DataFrame.fillna(value, *[, axis, inplace, ...])Example
orders.fillna({"units": 0})pandas.DataFrame.filtermethodSelect by labels on a DataFrame or Series. On GroupBy keep groups passing a boolean callable.
Call syntax
DataFrame.filter([arg, like, regex, axis, ...])Example
orders.filter(items=["team", "units"])-
Find the first index label containing a usable value.
Call syntax
DataFrame.first_valid_index() -
Divide corresponding values and round each quotient down.
Call syntax
DataFrame.floordiv(other[, axis, level, ...]) -
Create a pandas object from data exposed through the Arrow interface.
Call syntax
DataFrame.from_arrow(data) -
Build a DataFrame from a mapping of columns or rows.
Call syntax
DataFrame.from_dict(data[, orient, dtype, ...]) -
Build a DataFrame from record-like rows or a structured array.
Call syntax
DataFrame.from_records(data[, index, ...]) pandas.DataFrame.gemethodCompare corresponding values using greater-than-or-equal-to.
Call syntax
DataFrame.ge(other[, axis, level])pandas.DataFrame.getmethodRetrieve an object by key. A Series or DataFrame can also return a supplied default for an unknown key.
Call syntax
DataFrame.get(key[, default])pandas.DataFrame.groupbymethodSplit an object by keys to aggregate, transform, or filter each group.
Call syntax
DataFrame.groupby([by, level, as_index, ...])Example
orders.groupby("team", dropna=False)["units"].sum(min_count=1)pandas.DataFrame.gtmethodCompare corresponding values using greater-than.
Call syntax
DataFrame.gt(other[, axis, level])pandas.DataFrame.headmethodGet the first n rows or values. On GroupBy the limit applies within each group.
Call syntax
DataFrame.head([n])Example
orders.head(2)pandas.DataFrame.histmethodDraw histograms to show how numeric observations are distributed across bins.
Call syntax
DataFrame.hist([column, by, grid, ...])pandas.DataFrame.iatpropertyRead or set a single value using its integer row and column positions.
pandas.DataFrame.idxmaxmethodGet the label of the first maximum along the selected axis or within a group.
Call syntax
DataFrame.idxmax([axis, skipna, numeric_only])pandas.DataFrame.idxminmethodGet the label of the first minimum along the selected axis or within a group.
Call syntax
DataFrame.idxmin([axis, skipna, numeric_only])pandas.DataFrame.ilocpropertySelect or set values by zero-based integer position. A positional slice excludes its stop.
Example
orders.iloc[:2, :2]pandas.DataFrame.indexattributeGet the Index containing row labels.
-
Try a soft dtype conversion on object data without forcing strings to parse as numbers.
Call syntax
DataFrame.infer_objects([copy]) pandas.DataFrame.infomethodPrint a DataFrame summary with its index, column types, non-null counts and memory use.
Call syntax
DataFrame.info([verbose, buf, max_cols, ...])Example
orders.info()pandas.DataFrame.insertmethodInsert a column at the specified position in the existing DataFrame. A column with the same name raises ValueError by default.
Call syntax
DataFrame.insert(loc, column, value[, ...])-
Estimate missing values from neighboring observations using a selected interpolation method.
Call syntax
DataFrame.interpolate([method, axis, limit, ...]) -
Set a DataFrame column using its integer position.
Call syntax
DataFrame.isetitem(loc, value) pandas.DataFrame.isinmethodTest membership and return a boolean result for each value.
Call syntax
DataFrame.isin(values)pandas.DataFrame.isnamethodIdentify missing values. The result is a boolean for a scalar and a boolean mask for an array-like input.
Call syntax
DataFrame.isna()Example
orders.isna()pandas.DataFrame.isnullmethodUse isna to identify missing values.
Call syntax
DataFrame.isnull()pandas.DataFrame.itemsmethodIterate over label–value pairs. DataFrame yields each column label and its Series.
Call syntax
DataFrame.items()-
Iterate over DataFrame rows as index–Series pairs. A returned row can be coerced to a shared dtype.
Call syntax
DataFrame.iterrows() -
Iterate over DataFrame rows as tuples, optionally including index values.
Call syntax
DataFrame.itertuples([index, name]) pandas.DataFrame.joinmethodCombine tables using index labels or a specified key in the calling table.
Call syntax
DataFrame.join(other[, on, how, lsuffix, ...])pandas.DataFrame.keysmethodGet the DataFrame's column labels.
Call syntax
DataFrame.keys()pandas.DataFrame.kurtmethodEstimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
DataFrame.kurt(*[, axis, skipna, numeric_only])-
Use the same excess kurtosis calculation as kurt.
Call syntax
DataFrame.kurtosis(*[, axis, skipna, ...]) -
Find the last index label containing a usable value.
Call syntax
DataFrame.last_valid_index() pandas.DataFrame.lemethodCompare corresponding values using less-than-or-equal-to.
Call syntax
DataFrame.le(other[, axis, level])pandas.DataFrame.locpropertySelect or set values by label or a boolean mask. Label slices can include both endpoints.
Example
orders.loc[orders["team"].eq("North"), ["team", "units"]]pandas.DataFrame.ltmethodCompare corresponding values using less-than.
Call syntax
DataFrame.lt(other[, axis, level])pandas.DataFrame.mapmethodApply a scalar-to-scalar callable cell by cell. Use na_action="ignore" to skip missing cells.
Call syntax
DataFrame.map(func[, na_action])pandas.DataFrame.maskmethodReplace values wherever the condition is true.
Call syntax
DataFrame.mask(cond[, other, inplace, axis, ...])pandas.DataFrame.maxmethodFind the largest value in the selection, group or window.
Call syntax
DataFrame.max(*[, axis, skipna, numeric_only])pandas.DataFrame.meanmethodCalculate the arithmetic mean of values in the selection, group or window.
Call syntax
DataFrame.mean(*[, axis, skipna, numeric_only])pandas.DataFrame.medianmethodFind the middle of the sorted values, averaging the central pair when there are two.
Call syntax
DataFrame.median(*[, axis, skipna, numeric_only])pandas.DataFrame.meltmethodKeep identifier columns and turn measured columns into variable–value rows.
Call syntax
DataFrame.melt([id_vars, value_vars, ...])-
Report bytes accounted for by pandas. For object data, deep=True includes more of the referenced values.
Call syntax
DataFrame.memory_usage([index, deep]) pandas.DataFrame.mergemethodJoin tables by matching keys. Set how for the join type and validate to check the expected key relationship.
Call syntax
DataFrame.merge(right[, how, on, left_on, ...])Example
orders.merge(teams, on="team", how="left", validate="many_to_one")pandas.DataFrame.minmethodFind the smallest value in the selection, group or window.
Call syntax
DataFrame.min(*[, axis, skipna, numeric_only])pandas.DataFrame.modmethodCompute the remainder for each pair of values.
Call syntax
DataFrame.mod(other[, axis, level, fill_value])pandas.DataFrame.modemethodFind the value or values tied for highest frequency.
Call syntax
DataFrame.mode([axis, numeric_only, dropna])pandas.DataFrame.mulmethodMultiply corresponding values after any applicable label alignment.
Call syntax
DataFrame.mul(other[, axis, level, fill_value])pandas.DataFrame.ndimpropertyGet the number of axes, which is always two for a DataFrame.
pandas.DataFrame.nemethodCompare corresponding values for inequality.
Call syntax
DataFrame.ne(other[, axis, level])-
Get the n largest observations.
Call syntax
DataFrame.nlargest(n, columns[, keep])Example
orders.nlargest(2, "units") pandas.DataFrame.notnamethodIdentify present values by inverting the isna result.
Call syntax
DataFrame.notna()pandas.DataFrame.notnullmethodUse notna to identify present values.
Call syntax
DataFrame.notnull()-
Get the n smallest observations.
Call syntax
DataFrame.nsmallest(n, columns[, keep]) pandas.DataFrame.nuniquemethodCount distinct values. Set dropna=False to count missing values where supported.
Call syntax
DataFrame.nunique([axis, dropna])Example
orders.nunique(dropna=False)-
Compute fractional change from an earlier value. Multiply by 100 to express it as a percentage.
Call syntax
DataFrame.pct_change([periods, fill_method, ...]) pandas.DataFrame.pipemethodPass the current object to a callable while staying in a method chain.
Call syntax
DataFrame.pipe(func, *args, **kwargs)Example
orders.pipe(lambda frame: frame.dropna(subset=["units"]))pandas.DataFrame.pivotmethodMove distinct values into columns. Each output row–column pair needs a single source value.
Call syntax
DataFrame.pivot(*, columns[, index, values])-
Group rows and columns into a summary table. Use aggfunc to control how repeated combinations are reduced.
Call syntax
DataFrame.pivot_table([values, index, ...]) pandas.DataFrame.plotmethodCreate a chart using the chosen plotting backend and kind.
Call syntax
DataFrame.plot([x, y, kind, ax, ....])-
Plot filled areas to emphasize magnitude across an ordered axis.
Call syntax
DataFrame.plot.area([x, y, stacked]) -
Draw vertical bars for category comparisons.
Call syntax
DataFrame.plot.bar([x, y, color]) -
Draw horizontal bars, useful when category labels are long.
Call syntax
DataFrame.plot.barh([x, y, color]) -
Draw box plots to compare medians, quartiles and spread.
Call syntax
DataFrame.plot.box([by]) -
Plot a smooth estimate of the density of numeric values.
Call syntax
DataFrame.plot.density([bw_method, ind, weights]) -
Count or summarize nearby x–y observations in hexagonal cells.
Call syntax
DataFrame.plot.hexbin(x, y[, C, ...]) -
Draw histograms to show how numeric observations are distributed across bins.
Call syntax
DataFrame.plot.hist([by, bins]) -
Plot a kernel density estimate of numeric data.
Call syntax
DataFrame.plot.kde([bw_method, ind, weights]) -
Connect observations in their existing order with a line.
Call syntax
DataFrame.plot.line([x, y, color]) -
Draw slices with areas proportional to category values.
Call syntax
DataFrame.plot.pie([y]) -
Plot pairs of values as points to show their relationship.
Call syntax
DataFrame.plot.scatter(x, y[, s, c]) pandas.DataFrame.popmethodRemove a labeled entry and return it. A DataFrame returns the removed column.
Call syntax
DataFrame.pop(item)pandas.DataFrame.powmethodRaise each value to its corresponding exponent.
Call syntax
DataFrame.pow(other[, axis, level, fill_value])pandas.DataFrame.prodmethodMultiply values together along the selected axis, group or window.
Call syntax
DataFrame.prod(*[, axis, skipna, ...])pandas.DataFrame.productmethodUse prod to multiply values together.
Call syntax
DataFrame.product(*[, axis, skipna, ...])-
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
DataFrame.quantile([q, axis, numeric_only, ...]) pandas.DataFrame.querymethodFilter DataFrame rows using a trusted expression over columns or the index. Use @name to reference a local variable.
Call syntax
DataFrame.query(expr, *[, parser, engine, ...])Example
orders.query("units >= 5")pandas.DataFrame.raddmethodAdd using the supplied value as the left operand.
Call syntax
DataFrame.radd(other[, axis, level, fill_value])pandas.DataFrame.rankmethodAssign positions in sorted order and choose how to handle ties.
Call syntax
DataFrame.rank([axis, method, numeric_only, ...])pandas.DataFrame.rdivmethodDivide the supplied value by the object's values with true division.
Call syntax
DataFrame.rdiv(other[, axis, level, fill_value])pandas.DataFrame.reindexmethodConform to supplied labels and fill positions where those labels did not previously exist.
Call syntax
DataFrame.reindex([labels, index, columns, ...])-
Conform to the labels on another pandas object.
Call syntax
DataFrame.reindex_like(other[, method, ...]) pandas.DataFrame.renamemethodChange labels using a mapping or callable. A Series can also receive a new name.
Call syntax
DataFrame.rename([mapper, index, columns, ...])Example
orders.rename(columns={"units": "quantity"})-
Change the name of an axis while preserving its labels.
Call syntax
DataFrame.rename_axis([mapper, index, ...]) -
Rearrange levels of a hierarchical index.
Call syntax
DataFrame.reorder_levels(order[, axis]) pandas.DataFrame.replacemethodSubstitute values using a mapping or match pattern. Enable regex matching where needed.
Call syntax
DataFrame.replace([to_replace, value, ...])Example
orders.replace({"team": {"North": "N"}})-
Create time bins from a datetime-like axis, then reduce, fill or upsample within those bins.
Call syntax
DataFrame.resample(rule[, closed, label, ...]) -
Restore a default positional index. Existing index labels can become columns.
Call syntax
DataFrame.reset_index([level, drop, ...])Example
orders.set_index("team").reset_index() -
Use the supplied value as the numerator in floor division.
Call syntax
DataFrame.rfloordiv(other[, axis, level, ...]) pandas.DataFrame.rmodmethodCompute the supplied value modulo the object's values.
Call syntax
DataFrame.rmod(other[, axis, level, fill_value])pandas.DataFrame.rmulmethodMultiply using the supplied value as the left operand.
Call syntax
DataFrame.rmul(other[, axis, level, fill_value])pandas.DataFrame.rollingmethodBuild a moving window defined by an observation count, time span or custom indexer.
Call syntax
DataFrame.rolling(window[, min_periods, ...])pandas.DataFrame.roundmethodRound values to a specified precision. For datetime-like objects use a frequency.
Call syntax
DataFrame.round([decimals])pandas.DataFrame.rpowmethodUse the supplied values as bases and the object's values as exponents.
Call syntax
DataFrame.rpow(other[, axis, level, fill_value])pandas.DataFrame.rsubmethodSubtract the object's values from the supplied value.
Call syntax
DataFrame.rsub(other[, axis, level, fill_value])-
Use the supplied value as the numerator in true division.
Call syntax
DataFrame.rtruediv(other[, axis, level, ...]) pandas.DataFrame.samplemethodRandomly select rows, entries or columns. Set random_state for repeatable results.
Call syntax
DataFrame.sample([n, frac, replace, ...])Example
orders.sample(n=2, random_state=7)pandas.DataFrame.selectmethodBuild a DataFrame from selected columns and computed columns supplied as expressions or keyword callables.
Call syntax
DataFrame.select(*args, **kwargs)-
Keep or exclude columns based on their dtypes.
Call syntax
DataFrame.select_dtypes([include, exclude])Example
orders.select_dtypes(include="number") pandas.DataFrame.semmethodCalculate the standard error of the mean for the selected data.
Call syntax
DataFrame.sem(*[, axis, skipna, ddof, ...])-
Replace all labels on an axis with a new collection of equal length.
Call syntax
DataFrame.set_axis(labels, *[, axis, copy]) -
Get an object with changed flags, such as whether duplicate labels are allowed.
Call syntax
DataFrame.set_flags(*[, copy, ...]) -
Use columns or supplied arrays as the row index.
Call syntax
DataFrame.set_index(keys, *[, drop, append, ...])Example
orders.set_index("day") pandas.DataFrame.shapepropertyGet a pair containing the number of rows and columns.
Example
orders.shapepandas.DataFrame.shiftmethodMove values by a positional offset. With a time frequency, move the labels instead.
Call syntax
DataFrame.shift([periods, freq, axis, ...])pandas.DataFrame.sizepropertyGet the number of cells, including cells holding missing values.
pandas.DataFrame.skewmethodEstimate how asymmetric a numeric distribution is.
Call syntax
DataFrame.skew(*[, axis, skipna, numeric_only])-
Order rows or columns by their labels.
Call syntax
DataFrame.sort_index(*[, axis, level, ...])Example
orders.sort_index(ascending=False) -
Order items by one or more data values, controlling missing-value placement.
Call syntax
DataFrame.sort_values(by, *[, axis, ...])Example
orders.sort_values("units", ascending=False, na_position="last") pandas.DataFrame.sparse.densityattribute-
Create a sparse pandas object from a SciPy sparse matrix.
Call syntax
DataFrame.sparse.from_spmatrix(data[, ...]) -
Convert sparse pandas data to SciPy coordinate format.
Call syntax
DataFrame.sparse.to_coo() -
Materialize every value of a sparse object in a dense result.
Call syntax
DataFrame.sparse.to_dense() pandas.DataFrame.squeezemethodCollapse axes of length one, yielding a lower-dimensional object or scalar where possible.
Call syntax
DataFrame.squeeze([axis])pandas.DataFrame.stackmethodMove column levels into the row index.
Call syntax
DataFrame.stack([level, dropna, sort, ...])Example
orders.set_index("day")[["units"]].stack()pandas.DataFrame.stdmethodMeasure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
DataFrame.std(*[, axis, skipna, ddof, ...])pandas.DataFrame.stylepropertyGet a Styler for formatting values for display without changing their stored types.
pandas.DataFrame.submethodSubtract corresponding values after any applicable label alignment.
Call syntax
DataFrame.sub(other[, axis, level, fill_value])pandas.DataFrame.summethodAdd values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
DataFrame.sum(*[, axis, skipna, ...])-
Exchange two levels of a hierarchical index.
Call syntax
DataFrame.swaplevel([i, j, axis]) pandas.DataFrame.TpropertyGet the transposed table with rows and columns exchanged.
pandas.DataFrame.tailmethodGet the last n entries or rows. On GroupBy the limit applies per group.
Call syntax
DataFrame.tail([n])Example
orders.tail(2)pandas.DataFrame.takemethodSelect values by integer position in the order supplied.
Call syntax
DataFrame.take(indices[, axis])-
Copy the object's textual table representation to the system clipboard.
Call syntax
DataFrame.to_clipboard(*[, excel, sep]) pandas.DataFrame.to_csvmethodWrite delimited text or return it as a string. Use index=False when row labels should be excluded.
Call syntax
DataFrame.to_csv([path_or_buf, sep, na_rep, ...])Example
orders.to_csv(index=False)pandas.DataFrame.to_dictmethodConvert values to a Python mapping. DataFrame orient controls the shape of that mapping.
Call syntax
DataFrame.to_dict([orient, into, index])-
Write the receiver to an Excel sheet. Use ExcelWriter to manage multiple sheets in one workbook.
Call syntax
DataFrame.to_excel(excel_writer, *[, ...]) -
Write tabular data in the Feather columnar format.
Call syntax
DataFrame.to_feather(path, **kwargs) pandas.DataFrame.to_hdfmethodSave pandas data under a key in an HDF5 store.
Call syntax
DataFrame.to_hdf(path_or_buf, *, key[, ...])pandas.DataFrame.to_htmlmethodRender the receiver as an HTML table. A Styler includes applicable styling rules in its output.
Call syntax
DataFrame.to_html([buf, columns, col_space, ...])pandas.DataFrame.to_jsonmethodSerialize the object to JSON. Choose orient for the layout and lines for line-delimited records where supported.
Call syntax
DataFrame.to_json([path_or_buf, orient, ...])-
Produce a LaTeX table representation of the receiver.
Call syntax
DataFrame.to_latex([buf, columns, header, ...]) -
Render a table as Markdown text.
Call syntax
DataFrame.to_markdown([buf, mode, index, ...]) -
Convert values to a NumPy array. Mixed columns may require a common dtype.
Call syntax
DataFrame.to_numpy([dtype, copy, na_value]) pandas.DataFrame.to_orcmethodWrite a DataFrame in the ORC columnar format.
Call syntax
DataFrame.to_orc([path, engine, index, ...])-
Write a DataFrame in the Parquet columnar format. Set compression or partition_cols where needed.
Call syntax
DataFrame.to_parquet([path, engine, ...]) -
Convert the datetime index or selected axis to a PeriodIndex at the requested frequency.
Call syntax
DataFrame.to_period([freq, axis, copy]) -
Serialize a Python object into a pickle file for later restoration.
Call syntax
DataFrame.to_pickle(path, *[, compression, ...]) -
Get a NumPy record array with named fields.
Call syntax
DataFrame.to_records([index, column_dtypes, ...]) pandas.DataFrame.to_sqlmethodWrite tabular data to a SQL table. Use if_exists to control what happens when the table is already present.
Call syntax
DataFrame.to_sql(name, con, *[, schema, ...])-
Write a DataFrame as a Stata data file.
Call syntax
DataFrame.to_stata(path, *[, convert_dates, ...]) -
Return a human-readable textual representation or write it to the supplied buffer.
Call syntax
DataFrame.to_string([buf, columns, ...]) -
Convert the PeriodIndex on the selected axis to timestamps representing period starts or ends.
Call syntax
DataFrame.to_timestamp([freq, how, axis, copy]) -
Convert labeled pandas data to the corresponding xarray object.
Call syntax
DataFrame.to_xarray() -
Apply an operation and retain compatibility with the input shape. GroupBy aligns the result with the original rows.
Call syntax
DataFrame.transform(func[, axis]) -
Exchange row and column axes on two-dimensional data.
Call syntax
DataFrame.transpose(*args[, copy]) pandas.DataFrame.truedivmethodDivide corresponding values with true division.
Call syntax
DataFrame.truediv(other[, axis, level, ...])-
Keep labels within specified before and after bounds on a sorted axis.
Call syntax
DataFrame.truncate([before, after, axis, copy]) -
Express timezone-aware data in another zone while keeping the same instants.
Call syntax
DataFrame.tz_convert(tz[, axis, level, copy]) -
Assign a timezone to naive datetimes or remove it while keeping local clock values.
Call syntax
DataFrame.tz_localize(tz[, axis, level, ...]) pandas.DataFrame.unstackmethodMove an index level into the columns.
Call syntax
DataFrame.unstack([level, fill_value, sort])pandas.DataFrame.updatemethodModify the caller with nonmissing values aligned from another object.
Call syntax
DataFrame.update(other[, join, overwrite, ...])-
Count occurrences of each value or row combination. Set normalize for proportions and dropna=False to keep missing values.
Call syntax
DataFrame.value_counts([subset, normalize, ...]) pandas.DataFrame.valuespropertypandas.DataFrame.varmethodEstimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
DataFrame.var(*[, axis, skipna, ddof, ...])pandas.DataFrame.wheremethodKeep values where a condition is true and replace the rest with the supplied alternative.
Call syntax
DataFrame.where(cond[, other, inplace, ...])pandas.DataFrame.xsmethodSelect a cross-section by a label, optionally within one level of a hierarchical index.
Call syntax
DataFrame.xs(key[, axis, level, drop_level])pandas.Flagsclasspandas.MultiIndexclass
Series and accessors (342)
pandas.DataFrame.sparseaccessorGet the accessor for operations on sparse values.
pandas.Index.straccessorGet the accessor for vectorized operations on strings and string-like data.
pandas.Seriesclasspandas.Series.__array__methodExpose values through NumPy's array protocol.
Call syntax
Series.__array__([dtype, copy])pandas.Series.__invert__methodImplement ~ for the receiver. For a boolean mask, flip true and false.
Call syntax
Series.__invert__()pandas.Series.__iter__methodIterate through the values in Series order.
Call syntax
Series.__iter__()pandas.Series.absmethodTake the absolute value of each numeric element.
Call syntax
Series.abs()pandas.Series.addmethodAdd corresponding values. Labeled pandas operands align by their labels.
Call syntax
Series.add(other[, level, fill_value, axis])pandas.Series.add_prefixmethodPrepend text to labels on the chosen axis.
Call syntax
Series.add_prefix(prefix[, axis])pandas.Series.add_suffixmethodAppend text to labels on the chosen axis.
Call syntax
Series.add_suffix(suffix[, axis])pandas.Series.aggmethodSummarize values with named operations or callables. The result shape depends on the operations and object.
Call syntax
Series.agg([func, axis])pandas.Series.aggregatemethodSummarize values with one or more operations using the same interface as agg.
Call syntax
Series.aggregate([func, axis])pandas.Series.alignmethodReturn two objects with compatible labels. Set join to choose which labels to retain.
Call syntax
Series.align(other[, join, axis, level, ...])pandas.Series.allmethodTest whether every value along the selected axis or group evaluates to true.
Call syntax
Series.all(*[, axis, bool_only, skipna])pandas.Series.anymethodTest whether at least one value along the selected axis or group evaluates to true.
Call syntax
Series.any(*[, axis, bool_only, skipna])pandas.Series.applymethodRun a callable over the units of the object, such as rows, columns, groups, or windows. The receiver controls which units it passes to the callable.
Call syntax
Series.apply(func[, args, by_row])pandas.Series.argmaxmethodGet the integer position of the first maximum value.
Call syntax
Series.argmax([axis, skipna])pandas.Series.argminmethodGet the integer position of the first minimum value.
Call syntax
Series.argmin([axis, skipna])pandas.Series.argsortmethodGet positions describing the order that sorts the values.
Call syntax
Series.argsort([axis, kind, order, stable])pandas.Series.arraypropertypandas.Series.asfreqmethodConform the object to a frequency. Use resample to aggregate observations into time bins.
Call syntax
Series.asfreq(freq[, method, how, ...])pandas.Series.asofmethodLook up the last usable observation at or before the requested label.
Call syntax
Series.asof(where[, subset])pandas.Series.astypemethodConvert to another dtype. A DataFrame accepts a mapping to choose conversions column by column.
Call syntax
Series.astype(dtype[, copy, errors])pandas.Series.atpropertyRead or set a single Series value by its index label.
pandas.Series.at_timemethodSelect observations at one clock time from a datetime-indexed object.
Call syntax
Series.at_time(time[, asof, axis])pandas.Series.attrspropertypandas.Series.autocorrmethodCorrelate a Series with its own lagged values using the specified number of periods.
Call syntax
Series.autocorr([lag])pandas.Series.betweenmethodMake a boolean mask for values inside an interval. Set inclusive to control which endpoints count.
Call syntax
Series.between(left, right[, inclusive])Example
orders["units"].between(4, 7, inclusive="both")-
Select observations within a clock-time range, independent of their calendar dates.
Call syntax
Series.between_time(start_time, end_time[, ...]) pandas.Series.bfillmethodFill a gap using the next available value along the selected direction.
Call syntax
Series.bfill(*[, axis, inplace, limit, ...])pandas.Series.case_whenmethodChoose replacements using a sequence of condition–value pairs. If multiple conditions match, the first match wins.
Call syntax
Series.case_when(caselist)pandas.Series.cataccessorGet the accessor for categorical data and its metadata.
-
Extend the list of permitted categories without changing observations.
Call syntax
Series.cat.add_categories(new_categories) -
Mark categories as ordered so comparisons can use their declared order.
Call syntax
Series.cat.as_ordered() -
Mark categories as unordered, preserving their labels.
Call syntax
Series.cat.as_unordered() pandas.Series.cat.categoriesattributeGet the full set of allowed category labels, including those unused by current observations.
pandas.Series.cat.codesattributeGet integer positions in the category list. Missing values are represented with -1.
pandas.Series.cat.orderedattributeCheck whether the declared category order is meaningful for comparisons.
-
Remove selected categories and mark observations using them as missing.
Call syntax
Series.cat.remove_categories(removals) -
Remove declared categories that do not occur in the data.
Call syntax
Series.cat.remove_unused_categories() -
Change the labels of categories and preserve the underlying assignments.
Call syntax
Series.cat.rename_categories(new_categories) -
Set the order of existing categories without changing which category each value belongs to.
Call syntax
Series.cat.reorder_categories(new_categories) -
Replace the permitted categories. Observations outside the new set can become missing.
Call syntax
Series.cat.set_categories(new_categories[, ...]) pandas.Series.clipmethodClamp values to lower or upper limits, leaving values within the limits unchanged.
Call syntax
Series.clip([lower, upper, axis, inplace])pandas.Series.combinemethodCombine aligned objects using a callable. DataFrame passes columns to the callable and Series passes individual values.
Call syntax
Series.combine(other, func[, fill_value])-
Fill missing positions from a second aligned object while keeping existing valid values.
Call syntax
Series.combine_first(other) pandas.Series.comparemethodDisplay the differences between two equally labeled objects side by side.
Call syntax
Series.compare(other[, align_axis, ...])-
Infer dtypes with support for missing values, such as nullable integers or strings.
Call syntax
Series.convert_dtypes([infer_objects, ...]) pandas.Series.copymethodMake a copy of the receiver. For an HDFStore, copy stored data to a different file.
Call syntax
Series.copy([deep])pandas.Series.corrmethodCalculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
Series.corr(other[, method, min_periods])pandas.Series.countmethodCount nonmissing values along the selected axis or within each group or window.
Call syntax
Series.count()pandas.Series.covmethodEstimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
Series.cov(other[, min_periods, ddof])pandas.Series.cummaxmethodTrack the largest value encountered up to each position.
Call syntax
Series.cummax([axis, skipna])pandas.Series.cumminmethodTrack the smallest value encountered up to each position.
Call syntax
Series.cummin([axis, skipna])pandas.Series.cumprodmethodKeep a running product in observation order.
Call syntax
Series.cumprod([axis, skipna])pandas.Series.cumsummethodKeep a running total in observation order.
Call syntax
Series.cumsum([axis, skipna])Example
orders["units"].cumsum()pandas.Series.describemethodSummarize values with statistics appropriate to their dtype, such as quartiles for numbers or frequencies for categories.
Call syntax
Series.describe([percentiles, include, exclude])pandas.Series.diffmethodSubtract an earlier observation from the current one. Change periods to adjust the distance.
Call syntax
Series.diff([periods])Example
orders["units"].diff()pandas.Series.divmethodDivide corresponding values with true division, preserving fractional quotients.
Call syntax
Series.div(other[, level, fill_value, axis])pandas.Series.divmodmethodCalculate both element-wise floor quotients and remainders.
Call syntax
Series.divmod(other[, level, fill_value, axis])pandas.Series.dotmethodCompute a dot product or matrix multiplication, aligning shared labels where applicable.
Call syntax
Series.dot(other)pandas.Series.dropmethodRemove rows or columns by label. Specify columns= to make column removal explicit.
Call syntax
Series.drop([labels, axis, index, columns, ...])-
Keep one occurrence of duplicate values or rows by default. Use keep to choose which occurrences survive.
Call syntax
Series.drop_duplicates(*[, keep, inplace, ...]) pandas.Series.droplevelmethodRemove one or more levels of a hierarchical index.
Call syntax
Series.droplevel(level[, axis])pandas.Series.dropnamethodDrop entries with missing values. For DataFrames, subset restricts the columns considered when dropping rows.
Call syntax
Series.dropna(*[, axis, inplace, how, ...])pandas.Series.dtaccessorGet the accessor for datetime, timedelta or period properties and methods.
pandas.Series.dt.as_unitmethodChange the storage unit of time values, subject to precision and rounding rules.
Call syntax
Series.dt.as_unit(unit[, round_ok])pandas.Series.dt.ceilmethodRound timestamps or durations up to a frequency boundary.
Call syntax
Series.dt.ceil(freq[, ambiguous, nonexistent])pandas.Series.dt.componentsattributepandas.Series.dt.dateattributeExtract each calendar date as a standard-library date object.
pandas.Series.dt.dayattributeGet the day of the month from each date.
-
Get weekday names, optionally using a specified locale.
Call syntax
Series.dt.day_name([locale]) pandas.Series.dt.day_of_weekattributepandas.Series.dt.day_of_yearattributepandas.Series.dt.dayofweekattributeGet the weekday number, where Monday is 0 and Sunday is 6.
pandas.Series.dt.dayofyearattributepandas.Series.dt.daysattributepandas.Series.dt.days_in_monthattributepandas.Series.dt.daysinmonthattributepandas.Series.dt.end_timeattributepandas.Series.dt.floormethodRound timestamps or durations down to a frequency boundary.
Call syntax
Series.dt.floor(freq[, ambiguous, nonexistent])pandas.Series.dt.freqattributepandas.Series.dt.hourattributepandas.Series.dt.is_leap_yearattributepandas.Series.dt.is_month_endattributepandas.Series.dt.is_month_startattributepandas.Series.dt.is_quarter_endattributepandas.Series.dt.is_quarter_startattributepandas.Series.dt.is_year_endattributepandas.Series.dt.is_year_startattribute-
Get the ISO week-based year, week number and day of the week.
Call syntax
Series.dt.isocalendar() pandas.Series.dt.microsecondattributepandas.Series.dt.microsecondsattributepandas.Series.dt.minuteattributepandas.Series.dt.monthattributeGet the calendar month number from 1 to 12.
-
Get month names, optionally using a specified locale.
Call syntax
Series.dt.month_name([locale]) pandas.Series.dt.nanosecondattributepandas.Series.dt.nanosecondsattribute-
Set the clock time to midnight while preserving the calendar date and timezone.
Call syntax
Series.dt.normalize() pandas.Series.dt.quarterattributepandas.Series.dt.qyearattributepandas.Series.dt.roundmethodRound values to a specified precision. For datetime-like objects use a frequency.
Call syntax
Series.dt.round(freq[, ambiguous, nonexistent])pandas.Series.dt.secondattributepandas.Series.dt.secondsattributepandas.Series.dt.start_timeattribute-
Format a time value using strftime directives such as %Y-%m-%d. Period.strftime is deprecated in pandas 3.1.1.
Call syntax
Series.dt.strftime(date_format)Example
orders["day"].dt.strftime("%Y-%m") pandas.Series.dt.timeattributepandas.Series.dt.timetzattribute-
Convert the datetime values to periods at the supplied frequency.
Call syntax
Series.dt.to_period([freq]) -
Get a Series of standard-library datetime objects from the timestamp values.
Call syntax
Series.dt.to_pydatetime() -
Convert pandas durations to standard-library timedelta objects.
Call syntax
Series.dt.to_pytimedelta() -
Express a duration as seconds, including its fractional portion.
Call syntax
Series.dt.total_seconds() pandas.Series.dt.tzattribute-
Express timezone-aware data in another zone while keeping the same instants.
Call syntax
Series.dt.tz_convert(tz) -
Assign a timezone to naive datetimes or remove it while keeping local clock values.
Call syntax
Series.dt.tz_localize(tz[, ambiguous, ...]) pandas.Series.dt.unitattributepandas.Series.dt.weekdayattributepandas.Series.dt.yearattributeGet the calendar year from each datetime value.
pandas.Series.dtypepropertyGet the single dtype used by the Series.
pandas.Series.dtypespropertypandas.Series.duplicatedmethodMark repeated values or rows with a boolean mask. Use keep=False to mark every member of a duplicate set.
Call syntax
Series.duplicated([keep])pandas.Series.emptypropertyCheck whether the Series has zero entries.
pandas.Series.eqmethodCompare corresponding values for equality after any applicable label alignment.
Call syntax
Series.eq(other[, level, fill_value, axis])pandas.Series.equalsmethodCheck whether two objects have compatible shapes and the same contents, including missing values in the same locations.
Call syntax
Series.equals(other)pandas.Series.ewmmethodBuild an exponentially weighted window for calculations that emphasize recent observations.
Call syntax
Series.ewm([com, span, halflife, alpha, ...])pandas.Series.expandingmethodBuild a window that grows from the start through each observation.
Call syntax
Series.expanding([min_periods, method])pandas.Series.explodemethodExpand list-like cells into rows, repeating original row labels as needed.
Call syntax
Series.explode([ignore_index])Example
pd.Series([["A", "B"], ["C"]]).explode()pandas.Series.factorizemethodEncode distinct values as integers and return the codes alongside the corresponding unique values.
Call syntax
Series.factorize([sort, use_na_sentinel])pandas.Series.ffillmethodFill gaps with the most recent available value in the selected direction.
Call syntax
Series.ffill(*[, axis, inplace, limit, ...])pandas.Series.fillnamethodReplace missing values with supplied replacements, such as a scalar or values aligned by label.
Call syntax
Series.fillna(value, *[, axis, inplace, limit])pandas.Series.filtermethodSelect by labels on a DataFrame or Series. On GroupBy keep groups passing a boolean callable.
Call syntax
Series.filter([arg, like, regex, axis, ...])-
Find the first index label containing a usable value.
Call syntax
Series.first_valid_index() pandas.Series.flagspropertypandas.Series.floordivmethodDivide corresponding values and round each quotient down.
Call syntax
Series.floordiv(other[, level, fill_value, axis])pandas.Series.from_arrowmethodBuild a Series from an Arrow-compatible array-like object.
Call syntax
Series.from_arrow(data)pandas.Series.gemethodCompare corresponding values using greater-than-or-equal-to.
Call syntax
Series.ge(other[, level, fill_value, axis])pandas.Series.getmethodRetrieve an object by key. A Series or DataFrame can also return a supplied default for an unknown key.
Call syntax
Series.get(key[, default])pandas.Series.groupbymethodSplit an object by keys to aggregate, transform, or filter each group.
Call syntax
Series.groupby([by, level, as_index, sort, ...])pandas.Series.gtmethodCompare corresponding values using greater-than.
Call syntax
Series.gt(other[, level, fill_value, axis])pandas.Series.hasnanspropertypandas.Series.headmethodGet the first n rows or values. On GroupBy the limit applies within each group.
Call syntax
Series.head([n])pandas.Series.histmethodDraw histograms to show how numeric observations are distributed across bins.
Call syntax
Series.hist([by, ax, grid, xlabelsize, ...])pandas.Series.iatpropertyRead or set a single Series value by its integer position.
pandas.Series.idxmaxmethodGet the label of the first maximum along the selected axis or within a group.
Call syntax
Series.idxmax([axis, skipna])pandas.Series.idxminmethodGet the label of the first minimum along the selected axis or within a group.
Call syntax
Series.idxmin([axis, skipna])pandas.Series.ilocpropertySelect or set Series values by zero-based integer position.
pandas.Series.indexattributeGet the labels attached to the Series values.
-
Try a soft dtype conversion on object data without forcing strings to parse as numbers.
Call syntax
Series.infer_objects([copy]) pandas.Series.infomethodPrint a Series summary with its index, dtype, non-null count and memory use.
Call syntax
Series.info([verbose, buf, max_cols, ...])-
Estimate missing values from neighboring observations using a selected interpolation method.
Call syntax
Series.interpolate([method, axis, limit, ...]) pandas.Series.is_monotonic_decreasingpropertypandas.Series.is_monotonic_increasingpropertypandas.Series.is_uniquepropertypandas.Series.isinmethodTest membership and return a boolean result for each value.
Call syntax
Series.isin(values)Example
orders["team"].isin(["North"])pandas.Series.isnamethodIdentify missing values. The result is a boolean for a scalar and a boolean mask for an array-like input.
Call syntax
Series.isna()pandas.Series.isnullmethodUse isna to identify missing values.
Call syntax
Series.isnull()pandas.Series.itemmethodExtract a scalar. For a Series, Index or array, the default extraction requires exactly one element.
Call syntax
Series.item()pandas.Series.itemsmethodIterate through index–value pairs in Series order.
Call syntax
Series.items()pandas.Series.keysmethodGet the Series index.
Call syntax
Series.keys()pandas.Series.kurtmethodEstimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
Series.kurt(*[, axis, skipna, numeric_only])pandas.Series.kurtosismethodUse the same excess kurtosis calculation as kurt.
Call syntax
Series.kurtosis(*[, axis, skipna, numeric_only])-
Find the last index label containing a usable value.
Call syntax
Series.last_valid_index() pandas.Series.lemethodCompare corresponding values using less-than-or-equal-to.
Call syntax
Series.le(other[, level, fill_value, axis])-
Implement bracket indexing to select a value or subset.
Call syntax
Series.list.__getitem__(key) -
Expand each Arrow list into individual values, repeating the source index label for each child.
Call syntax
Series.list.flatten() pandas.Series.list.lenmethodMeasure the length of each element, such as the number of characters in each string.
Call syntax
Series.list.len()pandas.Series.locpropertySelect or set Series values by label or a boolean mask.
pandas.Series.ltmethodCompare corresponding values using less-than.
Call syntax
Series.lt(other[, level, fill_value, axis])pandas.Series.mapmethodMap each Series value through a callable, dictionary or Series lookup.
Call syntax
Series.map([func, na_action, engine])Example
orders["team"].map({"North": "N", "South": "S"})pandas.Series.maskmethodReplace values wherever the condition is true.
Call syntax
Series.mask(cond[, other, inplace, axis, level])pandas.Series.maxmethodFind the largest value in the selection, group or window.
Call syntax
Series.max(*[, axis, skipna, numeric_only])pandas.Series.meanmethodCalculate the arithmetic mean of values in the selection, group or window.
Call syntax
Series.mean(*[, axis, skipna, numeric_only])pandas.Series.medianmethodFind the middle of the sorted values, averaging the central pair when there are two.
Call syntax
Series.median(*[, axis, skipna, numeric_only])-
Report bytes accounted for by pandas. For object data, deep=True includes more of the referenced values.
Call syntax
Series.memory_usage([index, deep]) pandas.Series.minmethodFind the smallest value in the selection, group or window.
Call syntax
Series.min(*[, axis, skipna, numeric_only])pandas.Series.modmethodCompute the remainder for each pair of values.
Call syntax
Series.mod(other[, level, fill_value, axis])pandas.Series.modemethodFind the value or values tied for highest frequency.
Call syntax
Series.mode([dropna])pandas.Series.mulmethodMultiply corresponding values after any applicable label alignment.
Call syntax
Series.mul(other[, level, fill_value, axis])pandas.Series.namepropertyGet the Series name, often inherited from the DataFrame column selected.
pandas.Series.nbytespropertypandas.Series.ndimpropertypandas.Series.nemethodCompare corresponding values for inequality.
Call syntax
Series.ne(other[, level, fill_value, axis])pandas.Series.nlargestmethodGet the n largest observations.
Call syntax
Series.nlargest([n, keep])pandas.Series.notnamethodIdentify present values by inverting the isna result.
Call syntax
Series.notna()pandas.Series.notnullmethodUse notna to identify present values.
Call syntax
Series.notnull()pandas.Series.nsmallestmethodGet the n smallest observations.
Call syntax
Series.nsmallest([n, keep])pandas.Series.nuniquemethodCount distinct values. Set dropna=False to count missing values where supported.
Call syntax
Series.nunique([dropna])pandas.Series.pct_changemethodCompute fractional change from an earlier value. Multiply by 100 to express it as a percentage.
Call syntax
Series.pct_change([periods, fill_method, freq])pandas.Series.pipemethodPass the current object to a callable while staying in a method chain.
Call syntax
Series.pipe(func, *args, **kwargs)pandas.Series.plotmethodCreate a chart using the chosen plotting backend and kind.
Call syntax
Series.plot([kind, ax, figsize, ....])pandas.Series.plot.areamethodPlot filled areas to emphasize magnitude across an ordered axis.
Call syntax
Series.plot.area([x, y, stacked])pandas.Series.plot.barmethodDraw vertical bars for category comparisons.
Call syntax
Series.plot.bar([x, y, color])pandas.Series.plot.barhmethodDraw horizontal bars, useful when category labels are long.
Call syntax
Series.plot.barh([x, y, color])pandas.Series.plot.boxmethodDraw box plots to compare medians, quartiles and spread.
Call syntax
Series.plot.box([by])-
Plot a smooth estimate of the density of numeric values.
Call syntax
Series.plot.density([bw_method, ind, weights]) pandas.Series.plot.histmethodDraw histograms to show how numeric observations are distributed across bins.
Call syntax
Series.plot.hist([by, bins])pandas.Series.plot.kdemethodPlot a kernel density estimate of numeric data.
Call syntax
Series.plot.kde([bw_method, ind, weights])pandas.Series.plot.linemethodConnect observations in their existing order with a line.
Call syntax
Series.plot.line([x, y, color])pandas.Series.plot.piemethodDraw slices with areas proportional to category values.
Call syntax
Series.plot.pie([y])pandas.Series.popmethodRemove a labeled entry and return it. A DataFrame returns the removed column.
Call syntax
Series.pop(item)pandas.Series.powmethodRaise each value to its corresponding exponent.
Call syntax
Series.pow(other[, level, fill_value, axis])pandas.Series.prodmethodMultiply values together along the selected axis, group or window.
Call syntax
Series.prod(*[, axis, skipna, numeric_only, ...])pandas.Series.productmethodUse prod to multiply values together.
Call syntax
Series.product(*[, axis, skipna, ...])pandas.Series.quantilemethodEstimate the value at a specified fraction of the sorted distribution.
Call syntax
Series.quantile([q, interpolation])pandas.Series.raddmethodAdd using the supplied value as the left operand.
Call syntax
Series.radd(other[, level, fill_value, axis])pandas.Series.rankmethodAssign positions in sorted order and choose how to handle ties.
Call syntax
Series.rank([axis, method, numeric_only, ...])Example
orders["units"].rank(method="dense", ascending=False)pandas.Series.rdivmethodDivide the supplied value by the object's values with true division.
Call syntax
Series.rdiv(other[, level, fill_value, axis])pandas.Series.rdivmodmethodGet both quotient and remainder with the supplied values as the left operands.
Call syntax
Series.rdivmod(other[, level, fill_value, axis])pandas.Series.reindexmethodConform to supplied labels and fill positions where those labels did not previously exist.
Call syntax
Series.reindex([index, axis, method, copy, ...])-
Conform to the labels on another pandas object.
Call syntax
Series.reindex_like(other[, method, copy, ...]) pandas.Series.renamemethodChange labels using a mapping or callable. A Series can also receive a new name.
Call syntax
Series.rename([index, axis, copy, inplace, ...])-
Change the name of an axis while preserving its labels.
Call syntax
Series.rename_axis([mapper, index, axis, ...]) -
Rearrange levels of a hierarchical index.
Call syntax
Series.reorder_levels(order) pandas.Series.repeatmethodRepeat each value the given number of times. String repeat repeats the text within each element.
Call syntax
Series.repeat(repeats[, axis])pandas.Series.replacemethodSubstitute values using a mapping or match pattern. Enable regex matching where needed.
Call syntax
Series.replace([to_replace, value, inplace, ...])pandas.Series.resamplemethodCreate time bins from a datetime-like axis, then reduce, fill or upsample within those bins.
Call syntax
Series.resample(rule[, closed, label, ...])Example
orders.set_index("day")["units"].resample("2D").sum(min_count=1)-
Restore a default positional index. Existing index labels can become columns.
Call syntax
Series.reset_index([level, drop, name, ...]) pandas.Series.rfloordivmethodUse the supplied value as the numerator in floor division.
Call syntax
Series.rfloordiv(other[, level, fill_value, ...])pandas.Series.rmodmethodCompute the supplied value modulo the object's values.
Call syntax
Series.rmod(other[, level, fill_value, axis])pandas.Series.rmulmethodMultiply using the supplied value as the left operand.
Call syntax
Series.rmul(other[, level, fill_value, axis])pandas.Series.rollingmethodBuild a moving window defined by an observation count, time span or custom indexer.
Call syntax
Series.rolling(window[, min_periods, ...])Example
orders["units"].rolling(window=2, min_periods=1).mean()pandas.Series.roundmethodRound values to a specified precision. For datetime-like objects use a frequency.
Call syntax
Series.round([decimals])pandas.Series.rpowmethodUse the supplied values as bases and the object's values as exponents.
Call syntax
Series.rpow(other[, level, fill_value, axis])pandas.Series.rsubmethodSubtract the object's values from the supplied value.
Call syntax
Series.rsub(other[, level, fill_value, axis])pandas.Series.rtruedivmethodUse the supplied value as the numerator in true division.
Call syntax
Series.rtruediv(other[, level, fill_value, axis])pandas.Series.samplemethodRandomly select rows, entries or columns. Set random_state for repeatable results.
Call syntax
Series.sample([n, frac, replace, weights, ...])-
Get the insertion positions that preserve the order of sorted data.
Call syntax
Series.searchsorted(value[, side, sorter]) pandas.Series.semmethodCalculate the standard error of the mean for the selected data.
Call syntax
Series.sem(*[, axis, skipna, ddof, numeric_only])pandas.Series.set_axismethodReplace all labels on an axis with a new collection of equal length.
Call syntax
Series.set_axis(labels, *[, axis, copy])pandas.Series.set_flagsmethodGet an object with changed flags, such as whether duplicate labels are allowed.
Call syntax
Series.set_flags(*[, copy, ...])pandas.Series.shapepropertyGet the number of entries as a one-element tuple.
pandas.Series.shiftmethodMove values by a positional offset. With a time frequency, move the labels instead.
Call syntax
Series.shift([periods, freq, axis, ...])Example
orders["units"].shift(1)pandas.Series.sizepropertyGet the number of values, including missing values.
pandas.Series.skewmethodEstimate how asymmetric a numeric distribution is.
Call syntax
Series.skew(*[, axis, skipna, numeric_only])pandas.Series.sort_indexmethodOrder rows or columns by their labels.
Call syntax
Series.sort_index(*[, axis, level, ...])-
Order items by one or more data values, controlling missing-value placement.
Call syntax
Series.sort_values(*[, axis, ascending, ...]) pandas.Series.sparseaccessorGet the accessor for operations on sparse values.
pandas.Series.sparse.densityattributepandas.Series.sparse.fill_valueattribute-
Construct a sparse Series from a SciPy coordinate matrix.
Call syntax
Series.sparse.from_coo(A[, dense_index]) pandas.Series.sparse.npointsattributepandas.Series.sparse.sp_valuesattribute-
Convert sparse pandas data to SciPy coordinate format.
Call syntax
Series.sparse.to_coo([row_levels, ...]) pandas.Series.squeezemethodCollapse axes of length one, yielding a lower-dimensional object or scalar where possible.
Call syntax
Series.squeeze([axis])pandas.Series.stdmethodMeasure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
Series.std(*[, axis, skipna, ddof, numeric_only])pandas.Series.straccessorGet the accessor for vectorized operations on strings and string-like data.
-
Uppercase the initial character and lowercase the remaining text of each string.
Call syntax
Series.str.capitalize() -
Normalize case more aggressively than lower, useful for case-insensitive comparisons across languages.
Call syntax
Series.str.casefold() pandas.Series.str.catmethodJoin all strings into one value, or concatenate each row with aligned strings from other inputs.
Call syntax
Series.str.cat([others, sep, na_rep, join])pandas.Series.str.centermethodPad both sides of each string to reach a minimum width.
Call syntax
Series.str.center(width[, fillchar])-
Check whether each string contains a pattern. Set regex=False to match text literally.
Call syntax
Series.str.contains(pat[, case, flags, na, ...])Example
orders["team"].str.contains("north", case=False, regex=False) pandas.Series.str.countmethodCount nonoverlapping regex matches separately in each string.
Call syntax
Series.str.count(pat[, flags])Example
pd.Series(["A-A", "B-A"]).str.count("A")pandas.Series.str.decodemethodDecode byte strings to text with a selected character encoding.
Call syntax
Series.str.decode(encoding[, errors, dtype])pandas.Series.str.encodemethodEncode strings as bytes using a selected character encoding.
Call syntax
Series.str.encode(encoding[, errors])-
Check whether each string ends with the supplied suffix or any of the supplied suffixes.
Call syntax
Series.str.endswith(pat[, na]) -
Capture groups from the first matching region in each string. Use parentheses in the regular expression to define output fields.
Call syntax
Series.str.extract(pat[, flags, expand]) -
Return captures for every pattern match, adding a level to distinguish matches within the same row.
Call syntax
Series.str.extractall(pat[, flags]) pandas.Series.str.findmethodGet the first position of a substring, using -1 where it cannot be found.
Call syntax
Series.str.find(sub[, start, end])-
Collect all nonoverlapping regex matches separately for each string.
Call syntax
Series.str.findall(pat[, flags]) -
Test whether a regular expression matches the whole string.
Call syntax
Series.str.fullmatch(pat[, case, flags, na]) pandas.Series.str.getmethodExtract an element at the given position or key from each string or list-like value.
Call syntax
Series.str.get(i)-
Split each string into tokens and build a separate indicator column for each token.
Call syntax
Series.str.get_dummies([sep, dtype]) pandas.Series.str.indexmethodGet the first position of a substring, raising for an unsuccessful lookup.
Call syntax
Series.str.index(sub[, start, end])-
Test whether a string has at least one character and every character is a letter or a number.
Call syntax
Series.str.isalnum() -
Test whether all characters are alphabetic, with empty strings returning false.
Call syntax
Series.str.isalpha() -
Test whether all characters are in the ASCII character set.
Call syntax
Series.str.isascii() -
Test whether every character in a nonempty string is a Unicode decimal digit.
Call syntax
Series.str.isdecimal() -
Test whether every character in a nonempty string satisfies Unicode's digit rule.
Call syntax
Series.str.isdigit() -
Test whether all cased characters are lowercase and at least one cased character is present.
Call syntax
Series.str.islower() -
Test whether every character in a nonempty string has a Unicode numeric value.
Call syntax
Series.str.isnumeric() -
Test whether a nonempty string consists only of whitespace.
Call syntax
Series.str.isspace() -
Test whether a string follows Python's title-case rules.
Call syntax
Series.str.istitle() -
Test whether all cased characters are uppercase and at least one cased character is present.
Call syntax
Series.str.isupper() pandas.Series.str.joinmethodCombine the strings inside each list-like value with the specified separator.
Call syntax
Series.str.join(sep)pandas.Series.str.lenmethodMeasure the length of each element, such as the number of characters in each string.
Call syntax
Series.str.len()pandas.Series.str.ljustmethodPad the right-hand side of strings so the text is left-aligned at the desired width.
Call syntax
Series.str.ljust(width[, fillchar])pandas.Series.str.lowermethodConvert cased letters in each string to lowercase.
Call syntax
Series.str.lower()Example
orders["team"].str.lower()pandas.Series.str.lstripmethodRemove whitespace or specified characters from the start of each string.
Call syntax
Series.str.lstrip([to_strip])pandas.Series.str.matchmethodTest for a regex match at the beginning of each string.
Call syntax
Series.str.match(pat[, case, flags, na])-
Normalize Unicode text to a selected form such as NFC so equivalent spellings can compare equally.
Call syntax
Series.str.normalize(form) pandas.Series.str.padmethodPad each string to a minimum width on the requested side or sides.
Call syntax
Series.str.pad(width[, side, fillchar])-
Split at the first separator, returning the portions before and after it plus the separator itself.
Call syntax
Series.str.partition([sep, expand]) -
Remove the specified prefix once where it is present.
Call syntax
Series.str.removeprefix(prefix) -
Remove the specified suffix once where it is present.
Call syntax
Series.str.removesuffix(suffix) pandas.Series.str.repeatmethodRepeat each value the given number of times. String repeat repeats the text within each element.
Call syntax
Series.str.repeat(repeats)-
Replace matching substrings inside each value. Set regex=True for regular-expression matching.
Call syntax
Series.str.replace(pat[, repl, n, case, ...])Example
pd.Series(["A-01", "B-02"]).str.replace("-", "_", regex=False) pandas.Series.str.rfindmethodGet the last position of a substring, using -1 when there is no match.
Call syntax
Series.str.rfind(sub[, start, end])pandas.Series.str.rindexmethodGet the last position of a substring, raising for an unsuccessful lookup.
Call syntax
Series.str.rindex(sub[, start, end])pandas.Series.str.rjustmethodPad the left-hand side of strings so the text is right-aligned.
Call syntax
Series.str.rjust(width[, fillchar])-
Split into three parts at the last occurrence of a separator.
Call syntax
Series.str.rpartition([sep, expand]) pandas.Series.str.rsplitmethodSplit strings from the right, useful when limiting the number of splits.
Call syntax
Series.str.rsplit([pat, n, expand])pandas.Series.str.rstripmethodRemove whitespace or specified characters from the end of each string.
Call syntax
Series.str.rstrip([to_strip])pandas.Series.str.slicemethodTake a substring using Python-style start, stop and step positions.
Call syntax
Series.str.slice([start, stop, step])-
Replace the section of each string between two character positions.
Call syntax
Series.str.slice_replace([start, stop, repl]) pandas.Series.str.splitmethodSplit each string at a delimiter or pattern. Use expand=True to place parts in separate columns.
Call syntax
Series.str.split([pat, n, expand, regex])Example
pd.Series(["A-01", "B-02"]).str.split("-", expand=True)-
Check whether each string begins with the supplied prefix or any of the supplied prefixes.
Call syntax
Series.str.startswith(pat[, na]) pandas.Series.str.stripmethodRemove leading and trailing whitespace or the specified set of characters.
Call syntax
Series.str.strip([to_strip])Example
pd.Series([" North ", "South\t"]).str.strip()-
Convert lowercase letters to uppercase and uppercase letters to lowercase.
Call syntax
Series.str.swapcase() pandas.Series.str.titlemethodApply Python-style title casing to each string.
Call syntax
Series.str.title()-
Use a translation mapping to replace or remove individual characters.
Call syntax
Series.str.translate(table) pandas.Series.str.uppermethodConvert cased letters in each string to uppercase.
Call syntax
Series.str.upper()pandas.Series.str.wrapmethodBreak long strings into lines at the specified display width.
Call syntax
Series.str.wrap(width[, expand_tabs, ...])pandas.Series.str.zfillmethodPad the left side of strings with zeroes to reach a minimum width.
Call syntax
Series.str.zfill(width)pandas.Series.struct.dtypesattribute-
Extract every field of an Arrow struct Series into its own DataFrame column.
Call syntax
Series.struct.explode() -
Extract a named or positional field from an Arrow struct column.
Call syntax
Series.struct.field(name_or_index) pandas.Series.submethodSubtract corresponding values after any applicable label alignment.
Call syntax
Series.sub(other[, level, fill_value, axis])pandas.Series.summethodAdd values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
Series.sum(*[, axis, skipna, numeric_only, ...])pandas.Series.swaplevelmethodExchange two levels of a hierarchical index.
Call syntax
Series.swaplevel([i, j, copy])pandas.Series.Tpropertypandas.Series.tailmethodGet the last n entries or rows. On GroupBy the limit applies per group.
Call syntax
Series.tail([n])pandas.Series.takemethodSelect values by integer position in the order supplied.
Call syntax
Series.take(indices[, axis])-
Copy the object's textual table representation to the system clipboard.
Call syntax
Series.to_clipboard(*[, excel, sep]) pandas.Series.to_csvmethodWrite delimited text or return it as a string. Use index=False when row labels should be excluded.
Call syntax
Series.to_csv([path_or_buf, sep, na_rep, ...])pandas.Series.to_dictmethodBuild a Python mapping from index labels to values.
Call syntax
Series.to_dict(*[, into])pandas.Series.to_excelmethodWrite the receiver to an Excel sheet. Use ExcelWriter to manage multiple sheets in one workbook.
Call syntax
Series.to_excel(excel_writer, *[, ...])pandas.Series.to_framemethodTurn a one-dimensional pandas object into a DataFrame.
Call syntax
Series.to_frame([name])pandas.Series.to_hdfmethodSave pandas data under a key in an HDF5 store.
Call syntax
Series.to_hdf(path_or_buf, *, key[, mode, ...])pandas.Series.to_jsonmethodSerialize the object to JSON. Choose orient for the layout and lines for line-delimited records where supported.
Call syntax
Series.to_json([path_or_buf, orient, ...])pandas.Series.to_latexmethodProduce a LaTeX table representation of the receiver.
Call syntax
Series.to_latex([buf, columns, header, ...])pandas.Series.to_listmethodCollect the values in a native Python list.
Call syntax
Series.to_list()-
Render a table as Markdown text.
Call syntax
Series.to_markdown([buf, mode, index, ...]) pandas.Series.to_numpymethodConvert values to a NumPy array. Mixed columns may require a common dtype.
Call syntax
Series.to_numpy([dtype, copy, na_value])pandas.Series.to_periodmethodConvert the Series DatetimeIndex to a PeriodIndex, preserving the Series values.
Call syntax
Series.to_period([freq, copy])pandas.Series.to_picklemethodSerialize a Python object into a pickle file for later restoration.
Call syntax
Series.to_pickle(path, *[, compression, ...])pandas.Series.to_sqlmethodWrite tabular data to a SQL table. Use if_exists to control what happens when the table is already present.
Call syntax
Series.to_sql(name, con, *[, schema, ...])pandas.Series.to_stringmethodReturn a human-readable textual representation or write it to the supplied buffer.
Call syntax
Series.to_string([buf, na_rep, ...])-
Convert the Series PeriodIndex to timestamps representing period starts or ends.
Call syntax
Series.to_timestamp([freq, how, copy]) pandas.Series.to_xarraymethodConvert labeled pandas data to the corresponding xarray object.
Call syntax
Series.to_xarray()pandas.Series.transformmethodApply an operation and retain compatibility with the input shape. GroupBy aligns the result with the original rows.
Call syntax
Series.transform(func[, axis])pandas.Series.truedivmethodDivide corresponding values with true division.
Call syntax
Series.truediv(other[, level, fill_value, axis])pandas.Series.truncatemethodKeep labels within specified before and after bounds on a sorted axis.
Call syntax
Series.truncate([before, after, axis, copy])pandas.Series.tz_convertmethodExpress timezone-aware data in another zone while keeping the same instants.
Call syntax
Series.tz_convert(tz[, axis, level, copy])-
Assign a timezone to naive datetimes or remove it while keeping local clock values.
Call syntax
Series.tz_localize(tz[, axis, level, copy, ...]) pandas.Series.uniquemethodGet distinct values in encounter order without sorting.
Call syntax
Series.unique()pandas.Series.unstackmethodMove an index level into the columns.
Call syntax
Series.unstack([level, fill_value, sort])pandas.Series.updatemethodModify the caller with nonmissing values aligned from another object.
Call syntax
Series.update(other)-
Count occurrences of each value or row combination. Set normalize for proportions and dropna=False to keep missing values.
Call syntax
Series.value_counts([normalize, sort, ...])Example
orders["team"].value_counts(dropna=False) pandas.Series.valuespropertypandas.Series.varmethodEstimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
Series.var(*[, axis, skipna, ddof, numeric_only])pandas.Series.wheremethodKeep values where a condition is true and replace the rest with the supplied alternative.
Call syntax
Series.where(cond[, other, inplace, axis, level])Example
orders["units"].where(orders["units"].ge(5), other=0)pandas.Series.xsmethodSelect a cross-section by a label, optionally within one level of a hierarchical index.
Call syntax
Series.xs(key[, axis, level, drop_level])
GroupBy (128)
pandas.api.indexers.VariableOffsetWindowIndexerclass-
Support iteration, yielding columns for a DataFrame or key–object pairs for GroupBy.
Call syntax
DataFrameGroupBy.__iter__() -
Summarize values with named operations or callables. The result shape depends on the operations and object.
Call syntax
DataFrameGroupBy.agg([func, engine, ...]) -
Summarize values with one or more operations using the same interface as agg.
Call syntax
DataFrameGroupBy.aggregate([func, engine, ...]) -
Test whether every value along the selected axis or group evaluates to true.
Call syntax
DataFrameGroupBy.all([skipna]) -
Test whether at least one value along the selected axis or group evaluates to true.
Call syntax
DataFrameGroupBy.any([skipna]) -
Call a function with each group DataFrame and assemble the results. The callable can return a scalar, Series or DataFrame.
Call syntax
DataFrameGroupBy.apply(func, *args[, ...]) -
Fill a gap using the next available value along the selected direction.
Call syntax
DataFrameGroupBy.bfill([limit]) -
Draw box plots to compare medians, spread and possible outliers.
Call syntax
DataFrameGroupBy.boxplot([subplots, column, ...]) -
Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
DataFrameGroupBy.corr([method, min_periods, ...]) -
Calculate correlations between each group's columns and corresponding data in another object. This method is deprecated in pandas 3.1.1.
Call syntax
DataFrameGroupBy.corrwith(other[, drop, ...]) -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
DataFrameGroupBy.count() -
Estimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
DataFrameGroupBy.cov([min_periods, ddof, ...]) -
Number observations in encounter order inside each group, starting at zero.
Call syntax
DataFrameGroupBy.cumcount([ascending]) -
Track the largest value encountered up to each position.
Call syntax
DataFrameGroupBy.cummax([numeric_only, skipna]) -
Track the smallest value encountered up to each position.
Call syntax
DataFrameGroupBy.cummin([numeric_only, skipna]) -
Keep a running product in observation order.
Call syntax
DataFrameGroupBy.cumprod([numeric_only, skipna]) -
Keep a running total in observation order.
Call syntax
DataFrameGroupBy.cumsum([numeric_only, skipna]) -
Summarize values with statistics appropriate to their dtype, such as quartiles for numbers or frequencies for categories.
Call syntax
DataFrameGroupBy.describe([percentiles, ...]) -
Subtract an earlier observation from the current one. Change periods to adjust the distance.
Call syntax
DataFrameGroupBy.diff([periods]) -
Build an exponentially weighted window for calculations that emphasize recent observations.
Call syntax
DataFrameGroupBy.ewm([com, span, halflife, ...]) -
Build a window that grows from the start through each observation.
Call syntax
DataFrameGroupBy.expanding([min_periods, method]) -
Fill gaps with the most recent available value in the selected direction.
Call syntax
DataFrameGroupBy.ffill([limit]) -
Select by labels on a DataFrame or Series. On GroupBy keep groups passing a boolean callable.
Call syntax
DataFrameGroupBy.filter(func[, dropna]) -
Take the first value in each group or time bin, skipping missing values by default where supported.
Call syntax
DataFrameGroupBy.first([numeric_only, ...]) -
Retrieve the original observations belonging to the specified group key.
Call syntax
DataFrameGroupBy.get_group(name) pandas.api.typing.DataFrameGroupBy.groupsproperty-
Get the first n rows or values. On GroupBy the limit applies within each group.
Call syntax
DataFrameGroupBy.head([n]) -
Draw histograms to show how numeric observations are distributed across bins.
Call syntax
DataFrameGroupBy.hist([column, by, grid, ...]) -
Get the label of the first maximum along the selected axis or within a group.
Call syntax
DataFrameGroupBy.idxmax([skipna, numeric_only]) -
Get the label of the first minimum along the selected axis or within a group.
Call syntax
DataFrameGroupBy.idxmin([skipna, numeric_only]) pandas.api.typing.DataFrameGroupBy.indicesproperty-
Estimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
DataFrameGroupBy.kurt([skipna, numeric_only]) -
Take the last value in each group or time bin, skipping missing values by default where supported.
Call syntax
DataFrameGroupBy.last([numeric_only, ...]) -
Find the largest value in the selection, group or window.
Call syntax
DataFrameGroupBy.max([numeric_only, ...]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
DataFrameGroupBy.mean([numeric_only, ...]) -
Find the middle of the sorted values, averaging the central pair when there are two.
Call syntax
DataFrameGroupBy.median([numeric_only, skipna]) -
Find the smallest value in the selection, group or window.
Call syntax
DataFrameGroupBy.min([numeric_only, ...]) -
Assign each group a numeric identifier and return it for the corresponding rows.
Call syntax
DataFrameGroupBy.ngroup([ascending]) pandas.api.typing.DataFrameGroupBy.nthproperty-
Count distinct values. Set dropna=False to count missing values where supported.
Call syntax
DataFrameGroupBy.nunique([dropna]) -
Compute open, high, low and close values within each group or time bin.
Call syntax
DataFrameGroupBy.ohlc() -
Compute fractional change from an earlier value. Multiply by 100 to express it as a percentage.
Call syntax
DataFrameGroupBy.pct_change([periods, ...]) -
Pass the current object to a callable while staying in a method chain.
Call syntax
DataFrameGroupBy.pipe(func, *args, **kwargs) pandas.api.typing.DataFrameGroupBy.plotproperty-
Multiply values together along the selected axis, group or window.
Call syntax
DataFrameGroupBy.prod([numeric_only, ...]) -
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
DataFrameGroupBy.quantile([q, ...]) -
Assign positions in sorted order and choose how to handle ties.
Call syntax
DataFrameGroupBy.rank([method, ascending, ...]) -
Create time bins from a datetime-like axis, then reduce, fill or upsample within those bins.
Call syntax
DataFrameGroupBy.resample(rule[, closed, ...]) -
Build a moving window defined by an observation count, time span or custom indexer.
Call syntax
DataFrameGroupBy.rolling(window[, ...]) -
Randomly select rows, entries or columns. Set random_state for repeatable results.
Call syntax
DataFrameGroupBy.sample([n, frac, replace, ...]) -
Calculate the standard error of the mean for the selected data.
Call syntax
DataFrameGroupBy.sem([ddof, numeric_only, ...]) -
Move values by a positional offset. With a time frequency, move the labels instead.
Call syntax
DataFrameGroupBy.shift([periods, freq, ...]) -
Count rows in each group or bin, including rows whose values are missing.
Call syntax
DataFrameGroupBy.size() -
Estimate how asymmetric a numeric distribution is.
Call syntax
DataFrameGroupBy.skew([skipna, numeric_only]) -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
DataFrameGroupBy.std([ddof, engine, ...]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
DataFrameGroupBy.sum([numeric_only, ...]) -
Get the last n entries or rows. On GroupBy the limit applies per group.
Call syntax
DataFrameGroupBy.tail([n]) -
Select values by integer position in the order supplied.
Call syntax
DataFrameGroupBy.take(indices, **kwargs) -
Calculate group-level values and return a result aligned to the original DataFrame rows.
Call syntax
DataFrameGroupBy.transform([func, engine, ...]) -
Count occurrences of each value or row combination. Set normalize for proportions and dropna=False to keep missing values.
Call syntax
DataFrameGroupBy.value_counts([subset, ...]) -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
DataFrameGroupBy.var([ddof, engine, ...]) -
Support iteration, yielding columns for a DataFrame or key–object pairs for GroupBy.
Call syntax
SeriesGroupBy.__iter__() -
Summarize values with named operations or callables. The result shape depends on the operations and object.
Call syntax
SeriesGroupBy.agg([func, engine, engine_kwargs])Example
orders.groupby("team")["units"].agg(["size", "count", "sum"]) -
Summarize values with one or more operations using the same interface as agg.
Call syntax
SeriesGroupBy.aggregate([func, engine, ...]) -
Test whether every value along the selected axis or group evaluates to true.
Call syntax
SeriesGroupBy.all([skipna]) -
Test whether at least one value along the selected axis or group evaluates to true.
Call syntax
SeriesGroupBy.any([skipna]) -
Call a function with each grouped Series and assemble the results.
Call syntax
SeriesGroupBy.apply(func, *args, **kwargs) -
Fill a gap using the next available value along the selected direction.
Call syntax
SeriesGroupBy.bfill([limit]) -
Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
SeriesGroupBy.corr(other[, method, min_periods]) -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
SeriesGroupBy.count()Example
orders.groupby("team")["units"].count() -
Estimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
SeriesGroupBy.cov(other[, min_periods, ddof]) -
Number observations in encounter order inside each group, starting at zero.
Call syntax
SeriesGroupBy.cumcount([ascending])Example
orders.groupby("team").cumcount() -
Track the largest value encountered up to each position.
Call syntax
SeriesGroupBy.cummax([numeric_only, skipna]) -
Track the smallest value encountered up to each position.
Call syntax
SeriesGroupBy.cummin([numeric_only, skipna]) -
Keep a running product in observation order.
Call syntax
SeriesGroupBy.cumprod([numeric_only, skipna]) -
Keep a running total in observation order.
Call syntax
SeriesGroupBy.cumsum([numeric_only, skipna]) -
Summarize values with statistics appropriate to their dtype, such as quartiles for numbers or frequencies for categories.
Call syntax
SeriesGroupBy.describe([percentiles, ...]) -
Subtract an earlier observation from the current one. Change periods to adjust the distance.
Call syntax
SeriesGroupBy.diff([periods]) -
Build an exponentially weighted window for calculations that emphasize recent observations.
Call syntax
SeriesGroupBy.ewm([com, span, halflife, ...]) -
Build a window that grows from the start through each observation.
Call syntax
SeriesGroupBy.expanding([min_periods, method]) -
Fill gaps with the most recent available value in the selected direction.
Call syntax
SeriesGroupBy.ffill([limit]) -
Select by labels on a DataFrame or Series. On GroupBy keep groups passing a boolean callable.
Call syntax
SeriesGroupBy.filter(func[, dropna]) -
Take the first value in each group or time bin, skipping missing values by default where supported.
Call syntax
SeriesGroupBy.first([numeric_only, ...]) -
Retrieve the original observations belonging to the specified group key.
Call syntax
SeriesGroupBy.get_group(name)Example
orders.groupby("team")["units"].get_group("North") pandas.api.typing.SeriesGroupBy.groupsproperty-
Get the first n rows or values. On GroupBy the limit applies within each group.
Call syntax
SeriesGroupBy.head([n]) -
Draw histograms to show how numeric observations are distributed across bins.
Call syntax
SeriesGroupBy.hist([by, ax, grid, ...]) -
Get the label of the first maximum along the selected axis or within a group.
Call syntax
SeriesGroupBy.idxmax([skipna]) -
Get the label of the first minimum along the selected axis or within a group.
Call syntax
SeriesGroupBy.idxmin([skipna]) pandas.api.typing.SeriesGroupBy.indicespropertypandas.api.typing.SeriesGroupBy.is_monotonic_decreasingpropertypandas.api.typing.SeriesGroupBy.is_monotonic_increasingproperty-
Estimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
SeriesGroupBy.kurt([skipna, numeric_only]) -
Take the last value in each group or time bin, skipping missing values by default where supported.
Call syntax
SeriesGroupBy.last([numeric_only, ...]) -
Find the largest value in the selection, group or window.
Call syntax
SeriesGroupBy.max([numeric_only, min_count, ...]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
SeriesGroupBy.mean([numeric_only, skipna, ...]) -
Find the middle of the sorted values, averaging the central pair when there are two.
Call syntax
SeriesGroupBy.median([numeric_only, skipna]) -
Find the smallest value in the selection, group or window.
Call syntax
SeriesGroupBy.min([numeric_only, min_count, ...]) -
Assign each group a numeric identifier and return it for the corresponding rows.
Call syntax
SeriesGroupBy.ngroup([ascending]) -
Get the n largest observations.
Call syntax
SeriesGroupBy.nlargest([n, keep]) -
Get the n smallest observations.
Call syntax
SeriesGroupBy.nsmallest([n, keep]) pandas.api.typing.SeriesGroupBy.nthproperty-
Count distinct values. Set dropna=False to count missing values where supported.
Call syntax
SeriesGroupBy.nunique([dropna]) -
Compute open, high, low and close values within each group or time bin.
Call syntax
SeriesGroupBy.ohlc() -
Compute fractional change from an earlier value. Multiply by 100 to express it as a percentage.
Call syntax
SeriesGroupBy.pct_change([periods, ...]) -
Pass the current object to a callable while staying in a method chain.
Call syntax
SeriesGroupBy.pipe(func, *args, **kwargs) pandas.api.typing.SeriesGroupBy.plotproperty-
Multiply values together along the selected axis, group or window.
Call syntax
SeriesGroupBy.prod([numeric_only, ...]) -
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
SeriesGroupBy.quantile([q, interpolation, ...]) -
Assign positions in sorted order and choose how to handle ties.
Call syntax
SeriesGroupBy.rank([method, ascending, ...]) -
Create time bins from a datetime-like axis, then reduce, fill or upsample within those bins.
Call syntax
SeriesGroupBy.resample(rule[, closed, ...]) -
Build a moving window defined by an observation count, time span or custom indexer.
Call syntax
SeriesGroupBy.rolling(window[, min_periods, ...]) -
Randomly select rows, entries or columns. Set random_state for repeatable results.
Call syntax
SeriesGroupBy.sample([n, frac, replace, ...]) -
Calculate the standard error of the mean for the selected data.
Call syntax
SeriesGroupBy.sem([ddof, numeric_only, skipna]) -
Move values by a positional offset. With a time frequency, move the labels instead.
Call syntax
SeriesGroupBy.shift([periods, freq, ...]) -
Count rows in each group or bin, including rows whose values are missing.
Call syntax
SeriesGroupBy.size()Example
orders.groupby("team")["units"].size() -
Estimate how asymmetric a numeric distribution is.
Call syntax
SeriesGroupBy.skew([skipna, numeric_only]) -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
SeriesGroupBy.std([ddof, engine, ...]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
SeriesGroupBy.sum([numeric_only, min_count, ...]) -
Get the last n entries or rows. On GroupBy the limit applies per group.
Call syntax
SeriesGroupBy.tail([n]) -
Select values by integer position in the order supplied.
Call syntax
SeriesGroupBy.take(indices, **kwargs) -
Calculate group-level values and return a Series aligned to the original index.
Call syntax
SeriesGroupBy.transform(func, *args[, ...])Example
orders.groupby("team")["units"].transform("mean") -
Get distinct values in encounter order without sorting.
Call syntax
SeriesGroupBy.unique() -
Count occurrences of each value or row combination. Set normalize for proportions and dropna=False to keep missing values.
Call syntax
SeriesGroupBy.value_counts([normalize, ...]) -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
SeriesGroupBy.var([ddof, engine, ...]) pandas.Grouperclasspandas.NamedAggclass
Index objects (253)
pandas.api.types.is_scalarfunctionCheck whether a value is acceptable as a single scalar rather than an array of values.
Call syntax
api.types.is_scalar(val)pandas.Categoricalclasspandas.CategoricalIndexclass-
Extend the list of permitted categories without changing observations.
Call syntax
CategoricalIndex.add_categories(new_categories) -
Concatenate index entries in order. The result can preserve a categorical dtype when the inputs are compatible.
Call syntax
CategoricalIndex.append(other) -
Mark categories as ordered so comparisons can use their declared order.
Call syntax
CategoricalIndex.as_ordered() -
Mark categories as unordered, preserving their labels.
Call syntax
CategoricalIndex.as_unordered() pandas.CategoricalIndex.categoriespropertypandas.CategoricalIndex.codesproperty-
Check whether two objects have compatible shapes and the same contents, including missing values in the same locations.
Call syntax
CategoricalIndex.equals(other) -
Apply a substitution or callable to individual values. The receiver determines which mappers it supports.
Call syntax
CategoricalIndex.map(mapper[, na_action]) pandas.CategoricalIndex.orderedproperty-
Remove selected categories and mark observations using them as missing.
Call syntax
CategoricalIndex.remove_categories(removals) -
Remove declared categories that do not occur in the data.
Call syntax
CategoricalIndex.remove_unused_categories() -
Change the labels of categories and preserve the underlying assignments.
Call syntax
CategoricalIndex.rename_categories(...) -
Set the order of existing categories without changing which category each value belongs to.
Call syntax
CategoricalIndex.reorder_categories(...[, ...]) -
Replace the permitted categories. Observations outside the new set can become missing.
Call syntax
CategoricalIndex.set_categories(new_categories) pandas.DatetimeIndexclass-
Change the storage unit of time values, subject to precision and rounding rules.
Call syntax
DatetimeIndex.as_unit(unit) pandas.DatetimeIndex.asi8property-
Round timestamps or durations up to a frequency boundary.
Call syntax
DatetimeIndex.ceil(freq[, ambiguous, ...]) pandas.DatetimeIndex.datepropertypandas.DatetimeIndex.dayproperty-
Get weekday names, optionally using a specified locale.
Call syntax
DatetimeIndex.day_name([locale]) pandas.DatetimeIndex.day_of_weekpropertypandas.DatetimeIndex.day_of_yearpropertypandas.DatetimeIndex.dayofweekpropertypandas.DatetimeIndex.dayofyearproperty-
Round timestamps or durations down to a frequency boundary.
Call syntax
DatetimeIndex.floor(freq[, ambiguous, ...]) pandas.DatetimeIndex.freqpropertypandas.DatetimeIndex.freqstrpropertypandas.DatetimeIndex.hourproperty-
Find integer positions with the specified clock time in a DatetimeIndex.
Call syntax
DatetimeIndex.indexer_at_time(time[, asof]) -
Find integer positions between two clock times in a DatetimeIndex.
Call syntax
DatetimeIndex.indexer_between_time(...[, ...]) pandas.DatetimeIndex.inferred_freqattributepandas.DatetimeIndex.is_leap_yearpropertypandas.DatetimeIndex.is_month_endpropertypandas.DatetimeIndex.is_month_startpropertypandas.DatetimeIndex.is_quarter_endpropertypandas.DatetimeIndex.is_quarter_startpropertypandas.DatetimeIndex.is_year_endpropertypandas.DatetimeIndex.is_year_startproperty-
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
DatetimeIndex.mean(*[, skipna, axis]) pandas.DatetimeIndex.microsecondpropertypandas.DatetimeIndex.minutepropertypandas.DatetimeIndex.monthproperty-
Get month names, optionally using a specified locale.
Call syntax
DatetimeIndex.month_name([locale]) pandas.DatetimeIndex.nanosecondproperty-
Set the clock time to midnight while preserving the calendar date and timezone.
Call syntax
DatetimeIndex.normalize() pandas.DatetimeIndex.quarterproperty-
Round values to a specified precision. For datetime-like objects use a frequency.
Call syntax
DatetimeIndex.round(freq[, ambiguous, ...]) pandas.DatetimeIndex.secondproperty-
Move each timestamp to the closest point on the specified frequency.
Call syntax
DatetimeIndex.snap([freq]) pandas.DatetimeIndex.stdmethodMeasure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
DatetimeIndex.std([axis, dtype, out, ddof, ...])-
Format a time value using strftime directives such as %Y-%m-%d. Period.strftime is deprecated in pandas 3.1.1.
Call syntax
DatetimeIndex.strftime(date_format) pandas.DatetimeIndex.timepropertypandas.DatetimeIndex.timetzproperty-
Turn a one-dimensional pandas object into a DataFrame.
Call syntax
DatetimeIndex.to_frame([index, name]) -
Express each date or timestamp as a Julian day number.
Call syntax
DatetimeIndex.to_julian_date() -
Represent datetimes as periods at the selected frequency.
Call syntax
DatetimeIndex.to_period([freq]) -
Convert timestamps to standard-library datetime objects.
Call syntax
DatetimeIndex.to_pydatetime() -
Build a Series from the index values, using the original labels by default.
Call syntax
DatetimeIndex.to_series([index, name]) pandas.DatetimeIndex.tzproperty-
Express timezone-aware data in another zone while keeping the same instants.
Call syntax
DatetimeIndex.tz_convert(tz) -
Assign a timezone to naive datetimes or remove it while keeping local clock values.
Call syntax
DatetimeIndex.tz_localize(tz[, ambiguous, ...]) pandas.DatetimeIndex.unitpropertypandas.DatetimeIndex.weekdaypropertypandas.DatetimeIndex.yearpropertypandas.Indexclasspandas.Index.allmethodTest whether every value along the selected axis or group evaluates to true.
Call syntax
Index.all(*args, **kwargs)pandas.Index.anymethodTest whether at least one value along the selected axis or group evaluates to true.
Call syntax
Index.any(*args, **kwargs)pandas.Index.appendmethodConcatenate this index with one or more indexes in order, preserving repeated labels.
Call syntax
Index.append(other)pandas.Index.argmaxmethodGet the integer position of the first maximum value.
Call syntax
Index.argmax([axis, skipna])pandas.Index.argminmethodGet the integer position of the first minimum value.
Call syntax
Index.argmin([axis, skipna])pandas.Index.argsortmethodGet positions describing the order that sorts the values.
Call syntax
Index.argsort(*args, **kwargs)pandas.Index.arrayattributepandas.Index.asofmethodLook up the last usable observation at or before the requested label.
Call syntax
Index.asof(label)pandas.Index.asof_locsmethodFor each query, find the position of the last eligible value at or before it.
Call syntax
Index.asof_locs(where, mask)pandas.Index.astypemethodConvert to another dtype. A DataFrame accepts a mapping to choose conversions column by column.
Call syntax
Index.astype(dtype[, copy])pandas.Index.copymethodMake a copy of the receiver. For an HDFStore, copy stored data to a different file.
Call syntax
Index.copy([name, deep])pandas.Index.deletemethodRemove index entries at the specified integer positions.
Call syntax
Index.delete(loc)pandas.Index.differencemethodGet the labels in this index that are absent from the other collection.
Call syntax
Index.difference(other[, sort])pandas.Index.dropmethodRemove rows or columns by label. Specify columns= to make column removal explicit.
Call syntax
Index.drop(labels[, errors])-
Keep one occurrence of duplicate values or rows by default. Use keep to choose which occurrences survive.
Call syntax
Index.drop_duplicates(*[, keep]) pandas.Index.droplevelmethodRemove one or more levels of a hierarchical index.
Call syntax
Index.droplevel([level])pandas.Index.dropnamethodDrop entries with missing values. For DataFrames, subset restricts the columns considered when dropping rows.
Call syntax
Index.dropna([how])pandas.Index.dtypeattributepandas.Index.duplicatedmethodMark repeated values or rows with a boolean mask. Use keep=False to mark every member of a duplicate set.
Call syntax
Index.duplicated([keep])pandas.Index.emptypropertypandas.Index.equalsmethodCheck whether two objects have compatible shapes and the same contents, including missing values in the same locations.
Call syntax
Index.equals(other)pandas.Index.factorizemethodEncode distinct values as integers and return the codes alongside the corresponding unique values.
Call syntax
Index.factorize([sort, use_na_sentinel])pandas.Index.fillnamethodReplace missing values with supplied replacements, such as a scalar or values aligned by label.
Call syntax
Index.fillna(value)pandas.Index.get_indexermethodFind where target labels would come from in this index. Unmatched labels produce -1.
Call syntax
Index.get_indexer(target[, method, limit, ...])Example
pd.Index(["A", "B"]).get_indexer(["B", "C"])-
Find positions for the requested labels even when this index contains duplicates.
Call syntax
Index.get_indexer_for(target) -
Find all matching positions for target labels in a nonunique index and report the unmatched target positions.
Call syntax
Index.get_indexer_non_unique(target) -
Extract the index labels belonging to a hierarchical level.
Call syntax
Index.get_level_values(level) pandas.Index.get_locmethodLook up the position or positions for a supplied index key.
Call syntax
Index.get_loc(key)-
Find the integer start or end boundary of a label slice.
Call syntax
Index.get_slice_bound(label, side) pandas.Index.has_duplicatespropertyCheck whether any index label occurs more than once.
pandas.Index.hasnansattributepandas.Index.identicalmethodCheck that two indexes agree on values and index metadata such as type and names.
Call syntax
Index.identical(other)-
Try a soft dtype conversion on object data without forcing strings to parse as numbers.
Call syntax
Index.infer_objects([copy]) pandas.Index.inferred_typeattributepandas.Index.insertmethodAdd a value at a position. DataFrame inserts a column and rejects duplicate labels by default.
Call syntax
Index.insert(loc, item)-
Get the labels shared with another index or collection.
Call syntax
Index.intersection(other[, sort])Example
pd.Index(["A", "B"]).intersection(["B", "C"]) pandas.Index.is_methodCheck whether both indexes share the same identity marker, including views that preserve it.
Call syntax
Index.is_(other)pandas.Index.is_monotonic_decreasingpropertypandas.Index.is_monotonic_increasingpropertyCheck whether index values are in non-decreasing order.
pandas.Index.is_uniqueattributeCheck whether each index label occurs once.
pandas.Index.isinmethodTest membership and return a boolean result for each value.
Call syntax
Index.isin(values[, level])pandas.Index.isnamethodIdentify missing values. The result is a boolean for a scalar and a boolean mask for an array-like input.
Call syntax
Index.isna()pandas.Index.itemmethodExtract a scalar. For a Series, Index or array, the default extraction requires exactly one element.
Call syntax
Index.item()pandas.Index.joinmethodCombine labels using a join rule and optionally return indexers for the original indexes.
Call syntax
Index.join(other, *[, how, level, ...])pandas.Index.mapmethodApply a substitution or callable to individual values. The receiver determines which mappers it supports.
Call syntax
Index.map(mapper[, na_action])pandas.Index.maxmethodFind the largest value in the selection, group or window.
Call syntax
Index.max([axis, skipna])-
Report bytes accounted for by pandas. For object data, deep=True includes more of the referenced values.
Call syntax
Index.memory_usage([deep]) pandas.Index.minmethodFind the smallest value in the selection, group or window.
Call syntax
Index.min([axis, skipna])pandas.Index.namepropertypandas.Index.namespropertypandas.Index.nbytespropertypandas.Index.ndimpropertypandas.Index.notnamethodIdentify present values by inverting the isna result.
Call syntax
Index.notna()pandas.Index.nuniquemethodCount distinct values. Set dropna=False to count missing values where supported.
Call syntax
Index.nunique([dropna])pandas.Index.putmaskmethodBuild an index with replacements wherever the supplied boolean mask is true.
Call syntax
Index.putmask(mask, value)pandas.Index.ravelmethodReturn a one-dimensional view of the Index itself.
Call syntax
Index.ravel([order])pandas.Index.reindexmethodReturn the target index together with positions that map it to the current index.
Call syntax
Index.reindex(target[, method, level, ...])pandas.Index.renamemethodSet the name of an Index or the names of a MultiIndex.
Call syntax
Index.rename(name, *[, inplace])pandas.Index.repeatmethodRepeat each value the given number of times. String repeat repeats the text within each element.
Call syntax
Index.repeat(repeats[, axis])pandas.Index.replacemethodSubstitute values using a mapping or match pattern. Enable regex matching where needed.
Call syntax
Index.replace([to_replace, value, regex])-
Get the insertion positions that preserve the order of sorted data.
Call syntax
Index.searchsorted(value[, side, sorter]) pandas.Index.set_namesmethodSet one or more index level names, preserving their label values.
Call syntax
Index.set_names(names, *[, level, inplace])pandas.Index.shapepropertypandas.Index.shiftmethodMove time-based index labels by the requested number of frequency steps.
Call syntax
Index.shift([periods, freq])pandas.Index.sizeproperty-
Build a positional slice for the requested label interval.
Call syntax
Index.slice_indexer([start, end, step]) pandas.Index.slice_locsmethodGet the integer boundaries for a range of labels.
Call syntax
Index.slice_locs([start, end, step])pandas.Index.sort_valuesmethodOrder items by one or more data values, controlling missing-value placement.
Call syntax
Index.sort_values(*[, return_indexer, ...])-
Get labels occurring in exactly one of the two index collections.
Call syntax
Index.symmetric_difference(other[, ...]) pandas.Index.Tpropertypandas.Index.takemethodSelect values by integer position in the order supplied.
Call syntax
Index.take(indices[, axis, allow_fill, ...])pandas.Index.to_framemethodTurn a one-dimensional pandas object into a DataFrame.
Call syntax
Index.to_frame([index, name])pandas.Index.to_listmethodCollect the values in a native Python list.
Call syntax
Index.to_list()pandas.Index.to_numpymethodConvert values to a NumPy array. Mixed columns may require a common dtype.
Call syntax
Index.to_numpy([dtype, copy, na_value])pandas.Index.to_seriesmethodBuild a Series from the index values, using the original labels by default.
Call syntax
Index.to_series([index, name])pandas.Index.unionmethodCombine index labels from both collections into one index.
Call syntax
Index.union(other[, sort])Example
pd.Index(["A", "B"]).union(["B", "C"])pandas.Index.uniquemethodGet distinct values in encounter order without sorting.
Call syntax
Index.unique([level])-
Count occurrences of each value or row combination. Set normalize for proportions and dropna=False to keep missing values.
Call syntax
Index.value_counts([normalize, sort, ...]) pandas.Index.valuespropertypandas.Index.viewmethodExpose an alternate view or representation subject to the object's dtype and storage rules.
Call syntax
Index.view([cls])pandas.Index.wheremethodKeep values where a condition is true and replace the rest with the supplied alternative.
Call syntax
Index.where(cond[, other])pandas.IndexSlicedataBuild an indexer for selecting across levels of a MultiIndex.
pandas.IntervalIndexclasspandas.IntervalIndex.closedattributepandas.IntervalIndex.closed_leftpropertypandas.IntervalIndex.closed_rightproperty-
Check which intervals contain a given point, taking open and closed endpoints into account.
Call syntax
IntervalIndex.contains(other) -
Build an object from parallel arrays. For a MultiIndex each array supplies a level. For interval data the arrays supply left and right edges.
Call syntax
IntervalIndex.from_arrays(left, right[, ...]) -
Construct adjacent intervals from a sequence of consecutive boundaries.
Call syntax
IntervalIndex.from_breaks(breaks[, closed, ...]) -
Construct an index or interval array from tuples. An interval tuple supplies its two endpoints.
Call syntax
IntervalIndex.from_tuples(data[, closed, ...]) -
Find where target labels would come from in this index. Unmatched labels produce -1.
Call syntax
IntervalIndex.get_indexer(target[, method, ...]) -
Look up the position or positions for a supplied index key.
Call syntax
IntervalIndex.get_loc(key) pandas.IntervalIndex.is_emptypropertypandas.IntervalIndex.is_non_overlapping_monotonicattributepandas.IntervalIndex.is_overlappingpropertypandas.IntervalIndex.leftattributepandas.IntervalIndex.lengthpropertypandas.IntervalIndex.midattributepandas.IntervalIndex.open_leftpropertypandas.IntervalIndex.open_rightproperty-
Check whether intervals share any point, accounting for whether their endpoints are included.
Call syntax
IntervalIndex.overlaps(other) pandas.IntervalIndex.rightattribute-
Change which interval endpoints are included without moving their boundaries.
Call syntax
IntervalIndex.set_closed(closed) -
Expose each interval as a pair containing its left and right edge.
Call syntax
IntervalIndex.to_tuples([na_tuple]) pandas.IntervalIndex.valuespropertypandas.MultiIndex.appendmethodConcatenate entries from one or more indexes after aligning the relevant names and levels where possible.
Call syntax
MultiIndex.append(other)pandas.MultiIndex.codespropertypandas.MultiIndex.copymethodMake a copy of the receiver. For an HDFStore, copy stored data to a different file.
Call syntax
MultiIndex.copy([names, deep, name])pandas.MultiIndex.dropmethodRemove rows or columns by label. Specify columns= to make column removal explicit.
Call syntax
MultiIndex.drop(codes[, level, errors])-
Remove one or more levels of a hierarchical index.
Call syntax
MultiIndex.droplevel([level]) pandas.MultiIndex.dtypesattribute-
Build an object from parallel arrays. For a MultiIndex each array supplies a level. For interval data the arrays supply left and right edges.
Call syntax
MultiIndex.from_arrays(arrays[, sortorder, ...]) -
Build a MultiIndex with DataFrame columns providing index levels.
Call syntax
MultiIndex.from_frame(df[, sortorder, names]) -
Create a MultiIndex from all combinations of the supplied iterable levels.
Call syntax
MultiIndex.from_product(iterables[, ...]) -
Construct an index or interval array from tuples. An interval tuple supplies its two endpoints.
Call syntax
MultiIndex.from_tuples(tuples[, sortorder, ...]) -
Find where target labels would come from in this index. Unmatched labels produce -1.
Call syntax
MultiIndex.get_indexer(target[, method, ...]) -
Extract the index labels belonging to a hierarchical level.
Call syntax
MultiIndex.get_level_values(level) -
Look up the position or positions for a supplied index key.
Call syntax
MultiIndex.get_loc(key) -
Locate a key at a MultiIndex level and obtain the corresponding reduced index where possible.
Call syntax
MultiIndex.get_loc_level(key[, level, ...]) -
Get integer row locations matching a selection across MultiIndex levels.
Call syntax
MultiIndex.get_locs(seq) pandas.MultiIndex.levelsattributepandas.MultiIndex.levshapepropertypandas.MultiIndex.namespropertypandas.MultiIndex.nlevelsproperty-
Remove labels stored in MultiIndex levels that do not correspond to any entry.
Call syntax
MultiIndex.remove_unused_levels() -
Rearrange levels of a hierarchical index.
Call syntax
MultiIndex.reorder_levels(order) -
Change the integer codes that map entries to labels at each level.
Call syntax
MultiIndex.set_codes(codes, *[, level, ...]) -
Replace the collections of possible labels for specified MultiIndex levels.
Call syntax
MultiIndex.set_levels(levels, *[, level, ...]) -
Sort by the requested MultiIndex level and return the order used to rearrange entries.
Call syntax
MultiIndex.sortlevel([level, ascending, ...]) -
Exchange two levels of a hierarchical index.
Call syntax
MultiIndex.swaplevel([i, j]) -
Convert MultiIndex entries into an ordinary Index of tuples.
Call syntax
MultiIndex.to_flat_index() -
Create a DataFrame with one column per MultiIndex level.
Call syntax
MultiIndex.to_frame([index, name, ...]) -
Keep labels within specified before and after bounds on a sorted axis.
Call syntax
MultiIndex.truncate([before, after]) pandas.PeriodIndexclass-
Conform the object to a frequency. Use resample to aggregate observations into time bins.
Call syntax
PeriodIndex.asfreq([freq, how]) pandas.PeriodIndex.asi8propertypandas.PeriodIndex.daypropertypandas.PeriodIndex.day_of_weekpropertypandas.PeriodIndex.day_of_yearpropertypandas.PeriodIndex.dayofweekpropertypandas.PeriodIndex.dayofyearpropertypandas.PeriodIndex.days_in_monthpropertypandas.PeriodIndex.daysinmonthpropertypandas.PeriodIndex.end_timepropertypandas.PeriodIndex.freqpropertypandas.PeriodIndex.freqstrproperty-
Build a PeriodIndex from date fields such as years and quarters.
Call syntax
PeriodIndex.from_fields(*[, year, quarter, ...]) -
Build a PeriodIndex from integer period offsets at the selected frequency.
Call syntax
PeriodIndex.from_ordinals(ordinals, *, freq) pandas.PeriodIndex.hourpropertypandas.PeriodIndex.is_leap_yearpropertypandas.PeriodIndex.minutepropertypandas.PeriodIndex.monthpropertypandas.PeriodIndex.quarterpropertypandas.PeriodIndex.qyearpropertypandas.PeriodIndex.secondpropertypandas.PeriodIndex.start_timeproperty-
Format a time value using strftime directives such as %Y-%m-%d. Period.strftime is deprecated in pandas 3.1.1.
Call syntax
PeriodIndex.strftime(date_format) -
Represent a period by a timestamp at its start or end.
Call syntax
PeriodIndex.to_timestamp([freq, how]) pandas.PeriodIndex.weekpropertypandas.PeriodIndex.weekdaypropertypandas.PeriodIndex.weekofyearpropertypandas.PeriodIndex.yearpropertypandas.RangeIndexclass-
Build a compact RangeIndex from the start, stop and step of a Python range.
Call syntax
RangeIndex.from_range(data[, name, dtype]) pandas.RangeIndex.startpropertypandas.RangeIndex.steppropertypandas.RangeIndex.stoppropertypandas.TimedeltaIndexclass-
Change the storage unit of time values, subject to precision and rounding rules.
Call syntax
TimedeltaIndex.as_unit(unit) pandas.TimedeltaIndex.asi8property-
Round timestamps or durations up to a frequency boundary.
Call syntax
TimedeltaIndex.ceil(freq[, ambiguous, ...]) pandas.TimedeltaIndex.componentspropertypandas.TimedeltaIndex.daysproperty-
Round timestamps or durations down to a frequency boundary.
Call syntax
TimedeltaIndex.floor(freq[, ambiguous, ...]) pandas.TimedeltaIndex.inferred_freqattribute-
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
TimedeltaIndex.mean(*[, skipna, axis]) pandas.TimedeltaIndex.microsecondspropertypandas.TimedeltaIndex.nanosecondsproperty-
Round values to a specified precision. For datetime-like objects use a frequency.
Call syntax
TimedeltaIndex.round(freq[, ambiguous, ...]) pandas.TimedeltaIndex.secondsproperty-
Turn a one-dimensional pandas object into a DataFrame.
Call syntax
TimedeltaIndex.to_frame([index, name]) -
Convert pandas durations to standard-library timedelta objects.
Call syntax
TimedeltaIndex.to_pytimedelta() -
Build a Series from the index values, using the original labels by default.
Call syntax
TimedeltaIndex.to_series([index, name]) pandas.TimedeltaIndex.unitproperty
Arrays, scalars, and data types (245)
pandas.api.types.infer_dtypefunctionInspect values and classify their apparent type, such as integer, string or mixed.
Call syntax
api.types.infer_dtype(value[, skipna])-
Check for a real numeric dtype, excluding booleans and complex numbers.
Call syntax
api.types.is_any_real_numeric_dtype(arr_or_dtype) pandas.api.types.is_boolfunctionCheck whether a scalar is boolean.
Call syntax
api.types.is_bool(obj)pandas.api.types.is_bool_dtypefunctionCheck whether the input dtype represents booleans, including nullable booleans.
Call syntax
api.types.is_bool_dtype(arr_or_dtype)-
Check whether the input uses a categorical dtype. This check is deprecated. Use isinstance(dtype, pd.CategoricalDtype).
Call syntax
api.types.is_categorical_dtype(arr_or_dtype) pandas.api.types.is_complexfunctionCheck whether a scalar is a complex number.
Call syntax
api.types.is_complex(obj)-
Check whether the input uses a complex-number dtype.
Call syntax
api.types.is_complex_dtype(arr_or_dtype) -
Check for either a timezone-naive or timezone-aware datetime64 dtype.
Call syntax
api.types.is_datetime64_any_dtype(arr_or_dtype) -
Check whether the input uses a NumPy datetime64 dtype.
Call syntax
api.types.is_datetime64_dtype(arr_or_dtype) -
Check whether a datetime dtype uses nanosecond resolution.
Call syntax
api.types.is_datetime64_ns_dtype(arr_or_dtype) -
Check for a timezone-aware datetime dtype. Use isinstance(dtype, pd.DatetimeTZDtype) for new code.
Call syntax
api.types.is_datetime64tz_dtype(arr_or_dtype) pandas.api.types.is_dict_likefunctionCheck whether an object offers dictionary-like operations such as keyed access and keys.
Call syntax
api.types.is_dict_like(obj)pandas.api.types.is_dtype_equalfunctionCompare two inputs using pandas dtype equivalence.
Call syntax
api.types.is_dtype_equal(source, target)-
Check whether an input uses a pandas ExtensionDtype.
Call syntax
api.types.is_extension_array_dtype(arr_or_dtype) pandas.api.types.is_file_likefunctionCheck whether an object behaves like an iterable file with read or write support.
Call syntax
api.types.is_file_like(obj)pandas.api.types.is_floatfunctionCheck whether a scalar is floating-point.
Call syntax
api.types.is_float(obj)pandas.api.types.is_float_dtypefunctionCheck whether a dtype stores floating-point numbers.
Call syntax
api.types.is_float_dtype(arr_or_dtype)pandas.api.types.is_hashablefunctionCheck whether Python can compute a hash for this value.
Call syntax
api.types.is_hashable(obj[, allow_slice])pandas.api.types.is_int64_dtypefunctionCheck for a signed 64-bit integer dtype. This helper is deprecated.
Call syntax
api.types.is_int64_dtype(arr_or_dtype)pandas.api.types.is_integerfunctionCheck whether an individual value is an integer.
Call syntax
api.types.is_integer(obj)-
Check whether a dtype stores integers, including nullable integer types.
Call syntax
api.types.is_integer_dtype(arr_or_dtype) -
Check whether an input has interval dtype. Use isinstance(dtype, pd.IntervalDtype) for new code.
Call syntax
api.types.is_interval_dtype(arr_or_dtype) pandas.api.types.is_iteratorfunctionCheck for an object that supports getting its next value.
Call syntax
api.types.is_iterator(obj)pandas.api.types.is_list_likefunctionCheck whether an object behaves like a sequence, set or array for pandas purposes.
Call syntax
api.types.is_list_like(obj[, allow_sets])pandas.api.types.is_named_tuplefunctionCheck whether the value is a tuple whose fields have names.
Call syntax
api.types.is_named_tuple(obj)pandas.api.types.is_numberfunctionCheck whether a scalar is a numeric object.
Call syntax
api.types.is_number(obj)-
Check whether a dtype is numeric according to pandas.
Call syntax
api.types.is_numeric_dtype(arr_or_dtype) pandas.api.types.is_object_dtypefunctionCheck whether the input uses the generic NumPy object dtype.
Call syntax
api.types.is_object_dtype(arr_or_dtype)pandas.api.types.is_period_dtypefunctionCheck for a period dtype. Use isinstance(dtype, pd.PeriodDtype) for new code.
Call syntax
api.types.is_period_dtype(arr_or_dtype)pandas.api.types.is_refunctionCheck whether the input is an already compiled regular expression.
Call syntax
api.types.is_re(obj)-
Check whether the input can be compiled as a regular expression.
Call syntax
api.types.is_re_compilable(obj) -
Check for an integer dtype that can represent negative values.
Call syntax
api.types.is_signed_integer_dtype(arr_or_dtype) pandas.api.types.is_sparsefunctionCheck whether the input has sparse dtype. Use isinstance(dtype, pd.SparseDtype) for new code.
Call syntax
api.types.is_sparse(arr)pandas.api.types.is_string_dtypefunctionCheck whether the input dtype or applicable array values are string-like.
Call syntax
api.types.is_string_dtype(arr_or_dtype)-
Check for a NumPy timedelta dtype.
Call syntax
api.types.is_timedelta64_dtype(arr_or_dtype) -
Check for a NumPy timedelta dtype with nanosecond units.
Call syntax
api.types.is_timedelta64_ns_dtype(arr_or_dtype) -
Check for an integer dtype limited to nonnegative values.
Call syntax
api.types.is_unsigned_integer_dtype(arr_or_dtype) pandas.api.types.pandas_dtypefunctionNormalize a dtype specification to a pandas or NumPy dtype object.
Call syntax
api.types.pandas_dtype(dtype)-
Combine categorical values, forming a category set that can represent the combined result.
Call syntax
api.types.union_categoricals(to_union[, ...]) pandas.arrayfunctionBuild a one-dimensional pandas array and optionally specify its dtype.
Call syntax
pd.array(data[, dtype, copy])pandas.arrays.ArrowExtensionArrayclasspandas.arrays.ArrowStringArrayclasspandas.arrays.BooleanArrayclasspandas.arrays.DatetimeArrayclasspandas.arrays.FloatingArrayclasspandas.arrays.IntegerArrayclasspandas.arrays.IntervalArrayclasspandas.arrays.IntervalArray.closedproperty-
Check which intervals contain a given point, taking open and closed endpoints into account.
Call syntax
IntervalArray.contains(other) -
Build an object from parallel arrays. For a MultiIndex each array supplies a level. For interval data the arrays supply left and right edges.
Call syntax
IntervalArray.from_arrays(left, right, closed='right', copy=False, dtype=None) -
Construct adjacent intervals from a sequence of consecutive boundaries.
Call syntax
IntervalArray.from_breaks(breaks, closed='right', copy=False, dtype=None) -
Construct an index or interval array from tuples. An interval tuple supplies its two endpoints.
Call syntax
IntervalArray.from_tuples(data, closed='right', copy=False, dtype=None) pandas.arrays.IntervalArray.is_emptyattributepandas.arrays.IntervalArray.is_non_overlapping_monotonicpropertypandas.arrays.IntervalArray.leftpropertypandas.arrays.IntervalArray.lengthpropertypandas.arrays.IntervalArray.midproperty-
Check whether intervals share any point, accounting for whether their endpoints are included.
Call syntax
IntervalArray.overlaps(other) pandas.arrays.IntervalArray.rightproperty-
Change which interval endpoints are included without moving their boundaries.
Call syntax
IntervalArray.set_closed(closed) -
Expose each interval as a pair containing its left and right edge.
Call syntax
IntervalArray.to_tuples(na_tuple=True) pandas.arrays.PeriodArrayclasspandas.arrays.SparseArrayclasspandas.arrays.StringArrayclasspandas.arrays.TimedeltaArrayclasspandas.ArrowDtypeclasspandas.BooleanDtypeclass-
Expose values through NumPy's array protocol.
Call syntax
Categorical.__array__([dtype, copy]) -
Extend the list of permitted categories without changing observations.
Call syntax
Categorical.add_categories(new_categories) -
Mark categories as ordered so comparisons can use their declared order.
Call syntax
Categorical.as_ordered() -
Mark categories as unordered, preserving their labels.
Call syntax
Categorical.as_unordered() pandas.Categorical.categoriespropertypandas.Categorical.codespropertypandas.Categorical.dtypeproperty-
Build a categorical object using integer codes and existing categories.
Call syntax
Categorical.from_codes(codes[, categories, ...]) pandas.Categorical.mapmethodApply a substitution or callable to individual values. The receiver determines which mappers it supports.
Call syntax
Categorical.map(mapper[, na_action])pandas.Categorical.orderedproperty-
Remove selected categories and mark observations using them as missing.
Call syntax
Categorical.remove_categories(removals) -
Remove declared categories that do not occur in the data.
Call syntax
Categorical.remove_unused_categories() -
Change the labels of categories and preserve the underlying assignments.
Call syntax
Categorical.rename_categories(new_categories) -
Set the order of existing categories without changing which category each value belongs to.
Call syntax
Categorical.reorder_categories(new_categories) -
Replace the permitted categories. Observations outside the new set can become missing.
Call syntax
Categorical.set_categories(new_categories[, ...]) pandas.CategoricalDtypeclasspandas.CategoricalDtype.categoriespropertypandas.CategoricalDtype.orderedpropertypandas.DatetimeTZDtypeclasspandas.DatetimeTZDtype.tzpropertypandas.DatetimeTZDtype.unitpropertypandas.Float32Dtypeclasspandas.Float64Dtypeclasspandas.Int16Dtypeclasspandas.Int32Dtypeclasspandas.Int64Dtypeclasspandas.Int8Dtypeclasspandas.Intervalclasspandas.Interval.closedattributepandas.Interval.closed_leftattributepandas.Interval.closed_rightattributepandas.Interval.is_emptyattributepandas.Interval.leftattributepandas.Interval.lengthattributepandas.Interval.midattributepandas.Interval.open_leftattributepandas.Interval.open_rightattributepandas.Interval.overlapsmethodCheck whether intervals share any point, accounting for whether their endpoints are included.
Call syntax
Interval.overlaps(other)pandas.Interval.rightattributepandas.IntervalDtypeclasspandas.IntervalDtype.subtypepropertypandas.Periodclasspandas.Period.asfreqmethodConform the object to a frequency. Use resample to aggregate observations into time bins.
Call syntax
Period.asfreq(freq[, how])pandas.Period.dayattributepandas.Period.day_of_weekattributepandas.Period.day_of_yearattributepandas.Period.dayofweekattributepandas.Period.dayofyearattributepandas.Period.days_in_monthattributepandas.Period.daysinmonthattributepandas.Period.end_timeattributepandas.Period.freqattributepandas.Period.freqstrattributepandas.Period.hourattributepandas.Period.is_leap_yearattributepandas.Period.minuteattributepandas.Period.monthattributepandas.Period.nowmethodGet the current time in the requested timezone, or the current period at the supplied frequency for Period.
Call syntax
Period.now(freq)pandas.Period.ordinalattributepandas.Period.quarterattributepandas.Period.qyearattributepandas.Period.secondattributepandas.Period.start_timeattributepandas.Period.strftimemethodFormat this period with formatting directives. This method is deprecated in pandas 3.1.1. Convert to a timestamp first when its start or end is the intended value.
Call syntax
Period.strftime(fmt)-
Represent a period by a timestamp at its start or end.
Call syntax
Period.to_timestamp([freq, how]) pandas.Period.weekattributepandas.Period.weekdayattributepandas.Period.weekofyearattributepandas.Period.yearattributepandas.PeriodDtypeclasspandas.PeriodDtype.freqpropertypandas.SparseDtypeclasspandas.StringDtypeclasspandas.StringDtype.na_valuepropertypandas.StringDtype.storagepropertypandas.Timedeltaclasspandas.Timedelta.as_unitmethodChange the storage unit of time values, subject to precision and rounding rules.
Call syntax
Timedelta.as_unit(unit[, round_ok])pandas.Timedelta.asm8attributepandas.Timedelta.ceilmethodRound timestamps or durations up to a frequency boundary.
Call syntax
Timedelta.ceil(freq)pandas.Timedelta.componentsattributepandas.Timedelta.daysattributepandas.Timedelta.floormethodRound timestamps or durations down to a frequency boundary.
Call syntax
Timedelta.floor(freq)-
Express a timestamp or duration as text using its ISO 8601 format.
Call syntax
Timedelta.isoformat() pandas.Timedelta.maxattributepandas.Timedelta.microsecondsattributepandas.Timedelta.minattributepandas.Timedelta.nanosecondsattributepandas.Timedelta.resolutionattributepandas.Timedelta.resolution_stringattributepandas.Timedelta.roundmethodRound values to a specified precision. For datetime-like objects use a frequency.
Call syntax
Timedelta.round(freq)pandas.Timedelta.secondsattribute-
Convert the duration to a NumPy timedelta64 scalar.
Call syntax
Timedelta.to_numpy([dtype, copy]) -
Convert pandas durations to standard-library timedelta objects.
Call syntax
Timedelta.to_pytimedelta() -
Convert a pandas duration to a NumPy timedelta64 scalar.
Call syntax
Timedelta.to_timedelta64() -
Express a duration as seconds, including its fractional portion.
Call syntax
Timedelta.total_seconds() pandas.Timedelta.unitattributepandas.Timedelta.valueattributepandas.Timedelta.viewmethodExpose an alternate view or representation subject to the object's dtype and storage rules.
Call syntax
Timedelta.view(dtype)pandas.Timestampclasspandas.Timestamp.as_unitmethodChange the storage unit of time values, subject to precision and rounding rules.
Call syntax
Timestamp.as_unit(unit[, round_ok])pandas.Timestamp.asm8attribute-
Represent the same timestamp in another timezone.
Call syntax
Timestamp.astimezone(tz) pandas.Timestamp.ceilmethodRound timestamps or durations up to a frequency boundary.
Call syntax
Timestamp.ceil(freq[, ambiguous, nonexistent])pandas.Timestamp.combinemethodConstruct a single timestamp from a calendar date and clock time.
Call syntax
Timestamp.combine(date, time)pandas.Timestamp.ctimemethodFormat the timestamp as a human-readable ctime-style string.
Call syntax
Timestamp.ctime()pandas.Timestamp.datemethodExtract the calendar date as a standard-library date object.
Call syntax
Timestamp.date()pandas.Timestamp.dayattribute-
Get weekday names, optionally using a specified locale.
Call syntax
Timestamp.day_name([locale]) pandas.Timestamp.day_of_weekattributepandas.Timestamp.day_of_yearattributepandas.Timestamp.dayofweekattributepandas.Timestamp.dayofyearattributepandas.Timestamp.days_in_monthattributepandas.Timestamp.daysinmonthpropertypandas.Timestamp.dstmethodGet the daylight-saving adjustment associated with the timestamp, when a timezone is available.
Call syntax
Timestamp.dst()pandas.Timestamp.floormethodRound timestamps or durations down to a frequency boundary.
Call syntax
Timestamp.floor(freq[, ambiguous, nonexistent])pandas.Timestamp.foldattribute-
Construct a timestamp from an ISO year, week number and weekday.
Call syntax
Timestamp.fromisocalendar(year, week, day) -
Create a timestamp from a supported ISO date or datetime string.
Call syntax
Timestamp.fromisoformat(date_string) -
Create a timestamp from a proleptic Gregorian day number, where ordinal 1 is January 1 of year 1.
Call syntax
Timestamp.fromordinal(ordinal[, tz]) -
Create a timestamp from POSIX seconds, interpreted in the supplied timezone or local time.
Call syntax
Timestamp.fromtimestamp(ts[, tz]) pandas.Timestamp.hourattributepandas.Timestamp.is_leap_yearattributepandas.Timestamp.is_month_endattributepandas.Timestamp.is_month_startattributepandas.Timestamp.is_quarter_endattributepandas.Timestamp.is_quarter_startattributepandas.Timestamp.is_year_endattributepandas.Timestamp.is_year_startattribute-
Get the ISO week-based year, week number and day of the week.
Call syntax
Timestamp.isocalendar() -
Express a timestamp or duration as text using its ISO 8601 format.
Call syntax
Timestamp.isoformat([sep, timespec]) -
Map the weekday to an integer where Monday is 1 and Sunday is 7.
Call syntax
Timestamp.isoweekday() pandas.Timestamp.maxattributepandas.Timestamp.microsecondattributepandas.Timestamp.minattributepandas.Timestamp.minuteattributepandas.Timestamp.monthattribute-
Get month names, optionally using a specified locale.
Call syntax
Timestamp.month_name([locale]) pandas.Timestamp.nanosecondattribute-
Set the clock time to midnight while preserving the calendar date and timezone.
Call syntax
Timestamp.normalize() pandas.Timestamp.nowmethodGet the current time in the requested timezone, or the current period at the supplied frequency for Period.
Call syntax
Timestamp.now([tz])pandas.Timestamp.quarterattributepandas.Timestamp.replacemethodReturn a timestamp with selected fields such as year or hour updated.
Call syntax
Timestamp.replace([year, month, day, hour, ...])pandas.Timestamp.resolutionattributepandas.Timestamp.roundmethodRound values to a specified precision. For datetime-like objects use a frequency.
Call syntax
Timestamp.round(freq[, ambiguous, nonexistent])pandas.Timestamp.secondattribute-
Format a time value using strftime directives such as %Y-%m-%d. Period.strftime is deprecated in pandas 3.1.1.
Call syntax
Timestamp.strftime(format) -
A placeholder for parsing timestamp strings with a format. Use pd.to_datetime(value, format=...) because Timestamp.strptime raises NotImplementedError.
Call syntax
Timestamp.strptime(date_string, format) pandas.Timestamp.timemethodGet a Python time object containing the clock time, with no timezone attached.
Call syntax
Timestamp.time()-
Express the timestamp as seconds since the POSIX epoch.
Call syntax
Timestamp.timestamp() -
Get the calendar fields in a standard-library struct_time representation.
Call syntax
Timestamp.timetuple() pandas.Timestamp.timetzmethodExtract a Python time object including the timestamp's timezone information.
Call syntax
Timestamp.timetz()-
Convert the timestamp to a NumPy datetime64 scalar.
Call syntax
Timestamp.to_datetime64() -
Express each date or timestamp as a Julian day number.
Call syntax
Timestamp.to_julian_date() -
Convert the timestamp to a NumPy datetime64 scalar.
Call syntax
Timestamp.to_numpy([dtype, copy]) -
Identify the period containing the timestamp at the requested frequency.
Call syntax
Timestamp.to_period([freq]) -
Convert timestamps to standard-library datetime objects.
Call syntax
Timestamp.to_pydatetime([warn]) pandas.Timestamp.todaymethodGet a timestamp for the current local date and time.
Call syntax
Timestamp.today([tz])-
Get the Gregorian day number where January 1 of year 1 is 1.
Call syntax
Timestamp.toordinal() pandas.Timestamp.tzproperty-
Express timezone-aware data in another zone while keeping the same instants.
Call syntax
Timestamp.tz_convert(tz) -
Assign a timezone to naive datetimes or remove it while keeping local clock values.
Call syntax
Timestamp.tz_localize(tz[, ambiguous, ...]) pandas.Timestamp.tzinfopropertypandas.Timestamp.tznamemethodGet the name or abbreviation of the timestamp's timezone, if it has one.
Call syntax
Timestamp.tzname()pandas.Timestamp.unitattribute-
Construct a UTC timestamp from seconds since the POSIX epoch.
Call syntax
Timestamp.utcfromtimestamp(ts) pandas.Timestamp.utcnowmethodGet the current UTC timestamp. In pandas 3.1.1 use Timestamp.now(tz="UTC") for new code.
Call syntax
Timestamp.utcnow()-
Get the difference between local clock time and UTC as a duration.
Call syntax
Timestamp.utcoffset() -
Convert the timestamp to UTC calendar fields in struct_time form.
Call syntax
Timestamp.utctimetuple() pandas.Timestamp.valueattributepandas.Timestamp.weekattributepandas.Timestamp.weekdaymethodGet the day of the week as a number from Monday=0 to Sunday=6.
Call syntax
Timestamp.weekday()pandas.Timestamp.weekofyearattributepandas.Timestamp.yearattributepandas.UInt16Dtypeclasspandas.UInt32Dtypeclasspandas.UInt64Dtypeclasspandas.UInt8Dtypeclass
Date offsets and frequencies (186)
pandas._libs.tslibs.offsets.BaseOffsetclasspandas._libs.tslibs.offsets.BHalfYearBeginclasspandas._libs.tslibs.offsets.BHalfYearEndclasspandas._libs.tslibs.offsets.BQuarterBeginclasspandas._libs.tslibs.offsets.BQuarterEndclasspandas._libs.tslibs.offsets.BusinessDayclasspandas._libs.tslibs.offsets.BusinessHourclasspandas._libs.tslibs.offsets.BusinessMonthBeginclasspandas._libs.tslibs.offsets.BusinessMonthEndclasspandas._libs.tslibs.offsets.BYearBeginclasspandas._libs.tslibs.offsets.BYearEndclasspandas._libs.tslibs.offsets.CustomBusinessDayclasspandas._libs.tslibs.offsets.CustomBusinessHourclasspandas._libs.tslibs.offsets.CustomBusinessMonthBeginclasspandas._libs.tslibs.offsets.CustomBusinessMonthEndclasspandas._libs.tslibs.offsets.Dayclasspandas._libs.tslibs.offsets.Easterclasspandas._libs.tslibs.offsets.FY5253classpandas._libs.tslibs.offsets.FY5253Quarterclasspandas._libs.tslibs.offsets.HalfYearBeginclasspandas._libs.tslibs.offsets.HalfYearEndclasspandas._libs.tslibs.offsets.Hourclasspandas._libs.tslibs.offsets.LastWeekOfMonthclasspandas._libs.tslibs.offsets.Microclasspandas._libs.tslibs.offsets.Milliclasspandas._libs.tslibs.offsets.Minuteclasspandas._libs.tslibs.offsets.MonthBeginclasspandas._libs.tslibs.offsets.MonthEndclasspandas._libs.tslibs.offsets.Nanoclasspandas._libs.tslibs.offsets.QuarterBeginclasspandas._libs.tslibs.offsets.QuarterEndclasspandas._libs.tslibs.offsets.Secondclasspandas._libs.tslibs.offsets.SemiMonthBeginclasspandas._libs.tslibs.offsets.SemiMonthEndclasspandas._libs.tslibs.offsets.Tickclasspandas._libs.tslibs.offsets.Weekclasspandas._libs.tslibs.offsets.WeekOfMonthclasspandas._libs.tslibs.offsets.YearBeginclasspandas._libs.tslibs.offsets.YearEndclasspandas.DateOffsetclass-
Convert a frequency specification into a pandas DateOffset object.
Call syntax
to_offset(freq[, is_period]) pandas.tseries.holiday.AbstractHolidayCalendarclass-
List holiday occurrences within a date range using the calendar's configured rules.
Call syntax
AbstractHolidayCalendar.holidays([start, ...]) -
Combine this calendar's holiday rules with the rules from another calendar.
Call syntax
AbstractHolidayCalendar.merge(other[, inplace]) -
Combine holiday rules from two calendars into a single rule list.
Call syntax
AbstractHolidayCalendar.merge_class(base, other) -
Look up a calendar's holiday rule by its configured name.
Call syntax
AbstractHolidayCalendar.rule_from_name(name) -
Apply the nearest-weekday rule and then move ahead one business day.
Call syntax
after_nearest_workday(dt) -
Apply the nearest-weekday rule and then move back one business day.
Call syntax
before_nearest_workday(dt) -
Get an instance of a registered calendar by name.
Call syntax
get_calendar(name) pandas.tseries.holiday.Holidayclass-
Calculate the observed dates for a holiday rule over a requested range.
Call syntax
Holiday.dates(start_date, end_date[, ...]) -
Create a holiday calendar class by combining sets of rules.
Call syntax
HolidayCalendarFactory(name, base, other[, ...]) -
Observe a Saturday holiday on Friday and a Sunday holiday on Monday.
Call syntax
nearest_workday(dt) -
Observe Saturday or Sunday on the following Monday.
Call syntax
next_monday(dt) -
Observe Saturday on Monday and Sunday or Monday on Tuesday.
Call syntax
next_monday_or_tuesday(dt) -
Advance to the next weekday, skipping Saturday and Sunday.
Call syntax
next_workday(dt) -
Move Saturday and Sunday back to Friday.
Call syntax
previous_friday(dt) -
Move back to the previous weekday, skipping Saturday and Sunday.
Call syntax
previous_workday(dt) pandas.tseries.holiday.registerfunctionRegister a holiday calendar class so callers can look it up by name.
Call syntax
register(cls)-
Move a Sunday observance to Monday while leaving other weekdays as supplied.
Call syntax
sunday_to_monday(dt) pandas.tseries.holiday.USFederalHolidayCalendarclass-
Move a Saturday or Sunday observance to Monday.
Call syntax
weekend_to_monday(dt) pandas.tseries.offsets.BaseOffsetclass-
Create an independent offset with the same frequency and settings.
Call syntax
BaseOffset.copy() pandas.tseries.offsets.BaseOffset.freqstrattribute-
Check whether a timestamp falls on the month-end boundary according to this offset.
Call syntax
BaseOffset.is_month_end(ts) -
Check whether a timestamp falls on the month-start boundary according to this offset.
Call syntax
BaseOffset.is_month_start(ts) -
Check whether a timestamp already falls on the offset's schedule.
Call syntax
BaseOffset.is_on_offset(dt) -
Check whether a timestamp falls on the quarter-end boundary according to this offset.
Call syntax
BaseOffset.is_quarter_end(ts) -
Check whether a timestamp falls on the quarter-start boundary according to this offset.
Call syntax
BaseOffset.is_quarter_start(ts) -
Check whether a timestamp falls on the year-end boundary according to this offset.
Call syntax
BaseOffset.is_year_end(ts) -
Check whether a timestamp falls on the year-start boundary according to this offset.
Call syntax
BaseOffset.is_year_start(ts) pandas.tseries.offsets.BaseOffset.kwdsattributepandas.tseries.offsets.BaseOffset.nattributepandas.tseries.offsets.BaseOffset.nameattributepandas.tseries.offsets.BaseOffset.nanosattributepandas.tseries.offsets.BaseOffset.normalizeattribute-
Keep an on-schedule date or move it backward to the nearest offset date.
Call syntax
BaseOffset.rollback(dt) -
Keep an on-schedule date or move it forward to the nearest offset date.
Call syntax
BaseOffset.rollforward(dt) pandas.tseries.offsets.BaseOffset.rule_codeattributepandas.tseries.offsets.BDayattributepandas.tseries.offsets.BHalfYearBeginclasspandas.tseries.offsets.BHalfYearBegin.startingMonthattributepandas.tseries.offsets.BHalfYearEndclasspandas.tseries.offsets.BHalfYearEnd.startingMonthattributepandas.tseries.offsets.BMonthBeginattributepandas.tseries.offsets.BMonthEndattributepandas.tseries.offsets.BQuarterBeginclasspandas.tseries.offsets.BQuarterBegin.startingMonthattributepandas.tseries.offsets.BQuarterEndclasspandas.tseries.offsets.BQuarterEnd.startingMonthattributepandas.tseries.offsets.BusinessDayclasspandas.tseries.offsets.BusinessDay.calendarattributepandas.tseries.offsets.BusinessDay.holidaysattributepandas.tseries.offsets.BusinessDay.offsetattributepandas.tseries.offsets.BusinessDay.weekmaskattributepandas.tseries.offsets.BusinessHourclasspandas.tseries.offsets.BusinessHour.calendarattributepandas.tseries.offsets.BusinessHour.endattributepandas.tseries.offsets.BusinessHour.holidaysattributepandas.tseries.offsets.BusinessHour.offsetattributepandas.tseries.offsets.BusinessHour.startattributepandas.tseries.offsets.BusinessHour.weekmaskattributepandas.tseries.offsets.BusinessMonthBeginclasspandas.tseries.offsets.BusinessMonthEndclasspandas.tseries.offsets.BYearBeginclasspandas.tseries.offsets.BYearBegin.monthattributepandas.tseries.offsets.BYearEndclasspandas.tseries.offsets.BYearEnd.monthattributepandas.tseries.offsets.CBMonthBeginattributepandas.tseries.offsets.CBMonthEndattributepandas.tseries.offsets.CDayattributepandas.tseries.offsets.CustomBusinessDayclasspandas.tseries.offsets.CustomBusinessDay.calendarattributepandas.tseries.offsets.CustomBusinessDay.holidaysattributepandas.tseries.offsets.CustomBusinessDay.offsetattributepandas.tseries.offsets.CustomBusinessDay.weekmaskattributepandas.tseries.offsets.CustomBusinessHourclasspandas.tseries.offsets.CustomBusinessHour.calendarattributepandas.tseries.offsets.CustomBusinessHour.endattributepandas.tseries.offsets.CustomBusinessHour.holidaysattributepandas.tseries.offsets.CustomBusinessHour.offsetattributepandas.tseries.offsets.CustomBusinessHour.startattributepandas.tseries.offsets.CustomBusinessHour.weekmaskattributepandas.tseries.offsets.CustomBusinessMonthBeginclasspandas.tseries.offsets.CustomBusinessMonthBegin.calendarattributepandas.tseries.offsets.CustomBusinessMonthBegin.holidaysattributepandas.tseries.offsets.CustomBusinessMonthBegin.m_offsetattributepandas.tseries.offsets.CustomBusinessMonthBegin.offsetattributepandas.tseries.offsets.CustomBusinessMonthBegin.weekmaskattributepandas.tseries.offsets.CustomBusinessMonthEndclasspandas.tseries.offsets.CustomBusinessMonthEnd.calendarattributepandas.tseries.offsets.CustomBusinessMonthEnd.holidaysattributepandas.tseries.offsets.CustomBusinessMonthEnd.m_offsetattributepandas.tseries.offsets.CustomBusinessMonthEnd.offsetattributepandas.tseries.offsets.CustomBusinessMonthEnd.weekmaskattributepandas.tseries.offsets.DateOffsetclasspandas.tseries.offsets.Dayclasspandas.tseries.offsets.Easterclasspandas.tseries.offsets.FY5253class-
Get the suffix that encodes the parameters of a 52–53-week fiscal offset.
Call syntax
FY5253.get_rule_code_suffix() -
Compute a fiscal year-end date using the configured month, weekday and boundary rule.
Call syntax
FY5253.get_year_end(dt) pandas.tseries.offsets.FY5253.startingMonthattributepandas.tseries.offsets.FY5253.variationattributepandas.tseries.offsets.FY5253.weekdayattributepandas.tseries.offsets.FY5253Quarterclass-
Get the suffix that encodes the parameters of a 52–53-week fiscal offset.
Call syntax
FY5253Quarter.get_rule_code_suffix() -
Compute the length in weeks of each quarter in the fiscal year containing the date.
Call syntax
FY5253Quarter.get_weeks(dt) pandas.tseries.offsets.FY5253Quarter.qtr_with_extra_weekattributepandas.tseries.offsets.FY5253Quarter.startingMonthattributepandas.tseries.offsets.FY5253Quarter.variationattributepandas.tseries.offsets.FY5253Quarter.weekdayattribute-
Check whether the date's fiscal year contains 53 weeks.
Call syntax
FY5253Quarter.year_has_extra_week(dt) pandas.tseries.offsets.HalfYearBeginclasspandas.tseries.offsets.HalfYearBegin.startingMonthattributepandas.tseries.offsets.HalfYearEndclasspandas.tseries.offsets.HalfYearEnd.startingMonthattributepandas.tseries.offsets.Hourclasspandas.tseries.offsets.LastWeekOfMonthclasspandas.tseries.offsets.LastWeekOfMonth.weekattributepandas.tseries.offsets.LastWeekOfMonth.weekdayattributepandas.tseries.offsets.Microclasspandas.tseries.offsets.Milliclasspandas.tseries.offsets.Minuteclasspandas.tseries.offsets.MonthBeginclasspandas.tseries.offsets.MonthEndclasspandas.tseries.offsets.Nanoclasspandas.tseries.offsets.QuarterBeginclasspandas.tseries.offsets.QuarterBegin.startingMonthattributepandas.tseries.offsets.QuarterEndclasspandas.tseries.offsets.QuarterEnd.startingMonthattributepandas.tseries.offsets.Secondclasspandas.tseries.offsets.SemiMonthBeginclasspandas.tseries.offsets.SemiMonthBegin.day_of_monthattributepandas.tseries.offsets.SemiMonthEndclasspandas.tseries.offsets.SemiMonthEnd.day_of_monthattributepandas.tseries.offsets.Tickclasspandas.tseries.offsets.Weekclasspandas.tseries.offsets.Week.weekdayattributepandas.tseries.offsets.WeekOfMonthclasspandas.tseries.offsets.WeekOfMonth.weekattributepandas.tseries.offsets.WeekOfMonth.weekdayattributepandas.tseries.offsets.YearBeginclasspandas.tseries.offsets.YearBegin.monthattributepandas.tseries.offsets.YearEndclasspandas.tseries.offsets.YearEnd.monthattribute
Resampling (29)
-
Support iteration, yielding columns for a DataFrame or key–object pairs for GroupBy.
Call syntax
Resampler.__iter__() -
Summarize values with one or more operations using the same interface as agg.
Call syntax
Resampler.aggregate([func]) -
Run a callable over the units of the object, such as rows, columns, groups, or windows. The receiver controls which units it passes to the callable.
Call syntax
Resampler.apply([func]) -
Conform the time index to the target frequency, inserting gaps at newly introduced timestamps.
Call syntax
Resampler.asfreq([fill_value]) -
Fill gaps introduced by upsampling with later observations.
Call syntax
Resampler.bfill([limit]) -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
Resampler.count() -
Fill gaps introduced by upsampling with earlier observations.
Call syntax
Resampler.ffill([limit]) -
Take the first value in each group or time bin, skipping missing values by default where supported.
Call syntax
Resampler.first([numeric_only, min_count, ...]) -
Retrieve the original observations belonging to the specified group key.
Call syntax
Resampler.get_group(name) pandas.api.typing.Resampler.groupspropertypandas.api.typing.Resampler.indicesproperty-
Estimate missing values from neighboring observations using a selected interpolation method.
Call syntax
Resampler.interpolate([method, axis, limit, ...]) -
Take the last value in each group or time bin, skipping missing values by default where supported.
Call syntax
Resampler.last([numeric_only, min_count, skipna]) -
Find the largest value in the selection, group or window.
Call syntax
Resampler.max([numeric_only, min_count]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
Resampler.mean([numeric_only]) -
Find the middle of the sorted values, averaging the central pair when there are two.
Call syntax
Resampler.median([numeric_only]) -
Find the smallest value in the selection, group or window.
Call syntax
Resampler.min([numeric_only, min_count]) -
Fill new resampling positions from their nearest observations, optionally limiting consecutive fills.
Call syntax
Resampler.nearest([limit]) -
Count distinct values. Set dropna=False to count missing values where supported.
Call syntax
Resampler.nunique() -
Compute open, high, low and close values within each group or time bin.
Call syntax
Resampler.ohlc() -
Pass the current object to a callable while staying in a method chain.
Call syntax
Resampler.pipe(func, *args, **kwargs) -
Multiply values together along the selected axis, group or window.
Call syntax
Resampler.prod([numeric_only, min_count]) -
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
Resampler.quantile([q]) -
Calculate the standard error of the mean for the selected data.
Call syntax
Resampler.sem([ddof, numeric_only]) -
Count rows in each group or bin, including rows whose values are missing.
Call syntax
Resampler.size() -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
Resampler.std([ddof, numeric_only]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
Resampler.sum([numeric_only, min_count])Example
orders.set_index("day")["units"].resample("2D").sum(min_count=1) -
Apply an operation and retain compatibility with the input shape. GroupBy aligns the result with the original rows.
Call syntax
Resampler.transform(arg, *args, **kwargs) -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
Resampler.var([ddof, numeric_only])
Window operations (54)
pandas.api.indexers.BaseIndexerclasspandas.api.indexers.FixedForwardWindowIndexerclass-
Summarize values with one or more operations using the same interface as agg.
Call syntax
Expanding.aggregate([func]) -
Run a callable over the units of the object, such as rows, columns, groups, or windows. The receiver controls which units it passes to the callable.
Call syntax
Expanding.apply(func[, raw, engine, ...]) -
Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
Expanding.corr([other, pairwise, ddof, ...]) -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
Expanding.count([numeric_only]) -
Estimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
Expanding.cov([other, pairwise, ddof, ...]) -
Get the value from the left edge of each growing window.
Call syntax
Expanding.first([numeric_only]) -
Estimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
Expanding.kurt([numeric_only]) -
Get the value from the right edge of each growing window.
Call syntax
Expanding.last([numeric_only]) -
Find the largest value in the selection, group or window.
Call syntax
Expanding.max([numeric_only, engine, ...]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
Expanding.mean([numeric_only, engine, ...])Example
orders["units"].expanding(min_periods=1).mean() -
Find the middle of the sorted values, averaging the central pair when there are two.
Call syntax
Expanding.median([numeric_only, engine, ...]) -
Find the smallest value in the selection, group or window.
Call syntax
Expanding.min([numeric_only, engine, ...]) -
Count distinct values. Set dropna=False to count missing values where supported.
Call syntax
Expanding.nunique([numeric_only]) -
Pass the current object to a callable while staying in a method chain.
Call syntax
Expanding.pipe(func, *args, **kwargs) -
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
Expanding.quantile(q[, interpolation, ...]) -
Assign positions in sorted order and choose how to handle ties.
Call syntax
Expanding.rank([method, ascending, pct, ...]) -
Calculate the standard error of the mean for the selected data.
Call syntax
Expanding.sem([ddof, numeric_only]) -
Estimate how asymmetric a numeric distribution is.
Call syntax
Expanding.skew([numeric_only]) -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
Expanding.std([ddof, numeric_only, engine, ...]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
Expanding.sum([numeric_only, engine, ...]) -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
Expanding.var([ddof, numeric_only, engine, ...]) -
Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
ExponentialMovingWindow.corr([other, ...]) -
Estimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
ExponentialMovingWindow.cov([other, ...]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
ExponentialMovingWindow.mean([numeric_only, ...])Example
orders["units"].ewm(alpha=0.5).mean() -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
ExponentialMovingWindow.std([bias, numeric_only]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
ExponentialMovingWindow.sum([numeric_only, ...]) -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
ExponentialMovingWindow.var([bias, numeric_only]) -
Summarize values with one or more operations using the same interface as agg.
Call syntax
Rolling.aggregate([func]) -
Run a callable over the units of the object, such as rows, columns, groups, or windows. The receiver controls which units it passes to the callable.
Call syntax
Rolling.apply(func[, raw, engine, ...]) -
Calculate correlation coefficients between numeric inputs. A DataFrame can produce a column-by-column matrix.
Call syntax
Rolling.corr([other, pairwise, ddof, ...]) -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
Rolling.count([numeric_only]) -
Estimate how pairs of numeric inputs vary together from aligned observations.
Call syntax
Rolling.cov([other, pairwise, ddof, ...]) -
Get the value from the left edge of each moving window.
Call syntax
Rolling.first([numeric_only]) -
Estimate excess kurtosis, a statistic sensitive to heavy tails in a distribution.
Call syntax
Rolling.kurt([numeric_only]) -
Get the value from the right edge of each moving window.
Call syntax
Rolling.last([numeric_only]) -
Find the largest value in the selection, group or window.
Call syntax
Rolling.max([numeric_only, engine, ...]) -
Calculate the arithmetic mean of values in the selection, group or window.
Call syntax
Rolling.mean([numeric_only, engine, ...]) -
Find the middle of the sorted values, averaging the central pair when there are two.
Call syntax
Rolling.median([numeric_only, engine, ...]) -
Find the smallest value in the selection, group or window.
Call syntax
Rolling.min([numeric_only, engine, ...]) -
Count distinct values. Set dropna=False to count missing values where supported.
Call syntax
Rolling.nunique([numeric_only]) -
Pass the current object to a callable while staying in a method chain.
Call syntax
Rolling.pipe(func, *args, **kwargs) -
Estimate the value at a specified fraction of the sorted distribution.
Call syntax
Rolling.quantile(q[, interpolation, ...]) -
Assign positions in sorted order and choose how to handle ties.
Call syntax
Rolling.rank([method, ascending, pct, ...]) -
Calculate the standard error of the mean for the selected data.
Call syntax
Rolling.sem([ddof, numeric_only]) -
Estimate how asymmetric a numeric distribution is.
Call syntax
Rolling.skew([numeric_only]) -
Measure spread as the square root of variance. Use ddof to choose the divisor convention.
Call syntax
Rolling.std([ddof, numeric_only, engine, ...]) -
Add values along an axis or inside each group or window. Use min_count where supported to require usable observations.
Call syntax
Rolling.sum([numeric_only, engine, ...])Example
orders["units"].rolling(2, min_periods=1).sum() -
Estimate variance, the spread around the mean. ddof controls the divisor.
Call syntax
Rolling.var([ddof, numeric_only, engine, ...]) -
Average values in each rolling window using its configured weights.
Call syntax
Window.mean([numeric_only]) -
Calculate weighted standard deviation within each rolling window.
Call syntax
Window.std([ddof, numeric_only]) -
Total the values in each rolling window after applying its configured weights.
Call syntax
Window.sum([numeric_only]) -
Calculate weighted variance within each rolling window.
Call syntax
Window.var([ddof, numeric_only])
Missing values (2)
pandas.NAdataRepresent a missing scalar in pandas nullable dtypes such as Int64 and boolean.
pandas.NaTdataRepresent a missing datetime, timedelta, or period value.
Styling (42)
pandas.io.formats.style.Stylerclass-
Generate CSS styles by passing an entire column, row or table to a style function.
Call syntax
Styler.apply(func[, axis, subset]) -
Apply a style function to index or column labels one level at a time.
Call syntax
Styler.apply_index(func[, axis, level]) -
Shade cell backgrounds according to numeric values and the selected color map.
Call syntax
Styler.background_gradient([cmap, low, ...]) -
Draw a horizontal bar within each numeric table cell to visualize its value.
Call syntax
Styler.bar([subset, axis, color, cmap, ...]) -
Reset the Styler by removing its accumulated presentation settings.
Call syntax
Styler.clear() -
Append another Styler below the current table in the rendered output.
Call syntax
Styler.concat(other) pandas.io.formats.style.Styler.envattribute-
Collect reusable style settings for application to another Styler.
Call syntax
Styler.export() -
Change how cell values are displayed, such as decimal precision or missing-value text.
Call syntax
Styler.format([formatter, subset, na_rep, ...])Example
orders.style.format({"units": "{:.0f}"}, na_rep="—") -
Set how index labels or column headers are formatted for display.
Call syntax
Styler.format_index([formatter, axis, ...]) -
Set how the names of the index or columns are displayed.
Call syntax
Styler.format_index_names([formatter, axis, ...]) -
Build a Styler subclass using custom HTML templates.
Call syntax
Styler.from_custom_template(searchpath[, ...]) -
Hide labels, rows or columns in the rendered result while preserving the underlying data.
Call syntax
Styler.hide([subset, axis, level, names]) -
Apply a style to values within the supplied bounds.
Call syntax
Styler.highlight_between([subset, color, ...]) -
Highlight values tied for the maximum in the selected scope.
Call syntax
Styler.highlight_max([subset, color, axis, ...]) -
Highlight values tied for the minimum in the selected scope.
Call syntax
Styler.highlight_min([subset, color, axis, ...]) -
Style cells that hold missing values.
Call syntax
Styler.highlight_null([color, subset, props])Example
orders.style.highlight_null(color="gold") -
Highlight cells within selected quantile bounds.
Call syntax
Styler.highlight_quantile([subset, color, ...]) pandas.io.formats.style.Styler.loaderattribute-
Generate a CSS declaration for each data cell by calling the style function on its value.
Call syntax
Styler.map(func[, subset]) -
Apply a style callable to each individual index or column label.
Call syntax
Styler.map_index(func[, axis, level]) -
Pass the current object to a callable while staying in a method chain.
Call syntax
Styler.pipe(func, *args, **kwargs) -
Show substitute labels in the rendered table.
Call syntax
Styler.relabel_index(labels[, axis, level]) -
Attach a caption to the rendered table.
Call syntax
Styler.set_caption(caption) -
Set the same CSS properties on cells in the chosen subset.
Call syntax
Styler.set_properties([subset]) -
Keep selected headers in view when scrolling the rendered table.
Call syntax
Styler.set_sticky([axis, pixel_size, levels]) -
Add HTML attributes to the rendered table element.
Call syntax
Styler.set_table_attributes(attributes) -
Define CSS selectors and style declarations scoped to the rendered table.
Call syntax
Styler.set_table_styles([table_styles, ...]) -
Assign CSS classes to individual rendered data cells.
Call syntax
Styler.set_td_classes(classes) -
Attach hover text to matching cells in HTML output.
Call syntax
Styler.set_tooltips(ttips[, props, ...]) -
Set the identifier used to distinguish the generated table and its HTML elements.
Call syntax
Styler.set_uuid(uuid) pandas.io.formats.style.Styler.template_htmlattributepandas.io.formats.style.Styler.template_html_styleattributepandas.io.formats.style.Styler.template_html_tableattributepandas.io.formats.style.Styler.template_latexattributepandas.io.formats.style.Styler.template_stringattributepandas.io.formats.style.Styler.template_typstattribute-
Color cell text according to numeric values and the selected color map.
Call syntax
Styler.text_gradient([cmap, low, high, ...]) -
Return a human-readable textual representation or write it to the supplied buffer.
Call syntax
Styler.to_string([buf, encoding, ...]) -
Render the styled table as Typst source.
Call syntax
Styler.to_typst([buf, encoding, ...]) -
Apply reusable settings produced by Styler.export to the current table.
Call syntax
Styler.use(styles)
Plotting (12)
pandas.plotting.andrews_curvesfunctionPlot each record as a curve created from its numeric features and optionally color curves by class.
Call syntax
andrews_curves(frame, class_column[, ax, ...])-
Plot the correlation of a series with itself across multiple lags.
Call syntax
autocorrelation_plot(series[, ax]) pandas.plotting.bootstrap_plotfunctionPlot sample statistics for repeated bootstrap resamples to explore their variation.
Call syntax
bootstrap_plot(series[, fig, size, samples])pandas.plotting.boxplotfunctionDraw box plots to compare medians, spread and possible outliers.
Call syntax
boxplot(data[, column, by, ax, fontsize, ...])-
Remove the pandas date converters from Matplotlib's registry.
Call syntax
deregister_matplotlib_converters() pandas.plotting.lag_plotfunctionPlot observations against earlier observations to reveal serial patterns.
Call syntax
lag_plot(series[, lag, ax])-
Plot each observation as a line across multiple variable axes, grouped by class.
Call syntax
parallel_coordinates(frame, class_column[, ...]) pandas.plotting.plot_paramsdatapandas.plotting.radvizfunctionPlace observations inside a circle according to their relative values across feature anchors.
Call syntax
radviz(frame, class_column[, ax, color, ...])-
Register converters that let Matplotlib plot pandas-specific time values.
Call syntax
register_matplotlib_converters() pandas.plotting.scatter_matrixfunctionDraw pairwise scatter plots and univariate plots for numeric DataFrame columns.
Call syntax
scatter_matrix(frame[, alpha, figsize, ax, ...])pandas.plotting.tablefunctionAdd a table of pandas values to a Matplotlib axes.
Call syntax
table(ax, data, **kwargs)
Options and settings (6)
pandas.describe_optionfunctionDisplay an option's purpose, default and current value.
Call syntax
pd.describe_option([pat, _print_desc])pandas.get_optionfunctionRead the current value of a pandas option.
Call syntax
pd.get_option(pat)Example
pd.get_option("display.max_rows")pandas.option_contextfunctionTemporarily override options inside a with block and restore them on exit.
Call syntax
pd.option_context(*args)Example
with pd.option_context("display.max_rows", 4): print(orders)pandas.reset_optionfunctionRestore one or more pandas options to their default values.
Call syntax
pd.reset_option(pat)pandas.set_eng_float_formatfunctionSet a floating-point display formatter based on powers of 1000.
Call syntax
pd.set_eng_float_format([accuracy, use_eng_prefix])pandas.set_optionfunctionChange one or more pandas configuration values.
Call syntax
pd.set_option(*args)
Extensions (57)
pandas.api.extensions.ExtensionArrayclass-
Implement a cumulative operation such as cumsum for a custom extension array.
Call syntax
ExtensionArray._accumulate(name, *, skipna=True, **kwargs) -
Combine arrays of the same extension type into a single array.
Call syntax
ExtensionArray._concat_same_type(to_concat) -
Expand list-like entries and report the number of output values for each original element.
Call syntax
ExtensionArray._explode() -
Supply a callable that turns extension scalar values into display strings.
Call syntax
ExtensionArray._formatter(boxed=False) -
Rebuild an extension array from the unique values produced by a factorization operation.
Call syntax
ExtensionArray._from_factorized(values, original) -
Implement construction of a custom extension array from scalar input values.
Call syntax
ExtensionArray._from_sequence(scalars, *, dtype=None, copy=False) -
Parse a sequence of strings into values of the custom extension dtype.
Call syntax
ExtensionArray._from_sequence_of_strings(strings, *, dtype, copy=False) -
Implement element-wise hashing for a custom extension array.
Call syntax
ExtensionArray._hash_pandas_object(*, encoding, hash_key, categorize) pandas.api.extensions.ExtensionArray._is_monotonic_decreasingpropertypandas.api.extensions.ExtensionArray._is_monotonic_increasingproperty-
Implement directional missing-value filling for the extension array.
Call syntax
ExtensionArray._pad_or_backfill(*, method, limit=None, limit_area=None, copy=True) -
Implement scalar or length-one aggregation for the extension array.
Call syntax
ExtensionArray._reduce(name, *, skipna=True, keepdims=False, **kwargs) -
Expose values whose ordering describes how to sort the extension array.
Call syntax
ExtensionArray._values_for_argsort() -
Expose values for factorization together with the sentinel for missing data.
Call syntax
ExtensionArray._values_for_factorize() -
Get positions describing the order that sorts the values.
Call syntax
ExtensionArray.argsort(*, ascending=True, kind='quicksort', na_position='last', **kwargs) -
Convert to another dtype. A DataFrame accepts a mapping to choose conversions column by column.
Call syntax
ExtensionArray.astype(dtype, copy=True) -
Make a copy of the receiver. For an HDFStore, copy stored data to a different file.
Call syntax
ExtensionArray.copy() -
Count nonmissing values along the selected axis or within each group or window.
Call syntax
ExtensionArray.count() -
Drop entries with missing values. For DataFrames, subset restricts the columns considered when dropping rows.
Call syntax
ExtensionArray.dropna() pandas.api.extensions.ExtensionArray.dtypeproperty-
Mark repeated values or rows with a boolean mask. Use keep=False to mark every member of a duplicate set.
Call syntax
ExtensionArray.duplicated(keep='first') -
Check whether two objects have compatible shapes and the same contents, including missing values in the same locations.
Call syntax
ExtensionArray.equals(other) -
Encode distinct values as integers and return the codes alongside the corresponding unique values.
Call syntax
ExtensionArray.factorize(use_na_sentinel=True) -
Replace missing values with supplied replacements, such as a scalar or values aligned by label.
Call syntax
ExtensionArray.fillna(value, limit=None, copy=True) -
Add a value at a position. DataFrame inserts a column and rejects duplicate labels by default.
Call syntax
ExtensionArray.insert(loc, item) -
Estimate missing values from neighboring observations using a selected interpolation method.
Call syntax
ExtensionArray.interpolate(*, method, axis, index, limit, limit_direction, limit_area, copy, **kwargs) -
Test membership and return a boolean result for each value.
Call syntax
ExtensionArray.isin(values) -
Identify missing values. The result is a boolean for a scalar and a boolean mask for an array-like input.
Call syntax
ExtensionArray.isna() -
Extract the value at index as a Python scalar. Without index, the array must contain exactly one value.
Call syntax
ExtensionArray.item(index=None) pandas.api.extensions.ExtensionArray.nbytespropertypandas.api.extensions.ExtensionArray.ndimproperty-
Expose index or array values in a one-dimensional NumPy array.
Call syntax
ExtensionArray.ravel(order='C') -
Repeat each value the given number of times. String repeat repeats the text within each element.
Call syntax
ExtensionArray.repeat(repeats, axis=None) -
Get the insertion positions that preserve the order of sorted data.
Call syntax
ExtensionArray.searchsorted(value, side='left', sorter=None) pandas.api.extensions.ExtensionArray.shapeproperty-
Move values by a positional offset, filling the vacated positions as requested.
Call syntax
ExtensionArray.shift(periods=1, fill_value=None) -
Reorder the extension array in place with the requested sort direction and missing-value placement. Immutable implementations can reject this operation.
Call syntax
ExtensionArray.sort(*, ascending=True, kind='quicksort', na_position='last') -
Select values by integer position in the order supplied.
Call syntax
ExtensionArray.take(indices, *, allow_fill=False, fill_value=None) -
Collect the values in a native Python list.
Call syntax
ExtensionArray.tolist() -
Get distinct values in encounter order without sorting.
Call syntax
ExtensionArray.unique() -
Expose an alternate view or representation subject to the object's dtype and storage rules.
Call syntax
ExtensionArray.view(dtype=None) pandas.api.extensions.ExtensionDtypeclass-
Get the array class that stores values for the extension dtype.
Call syntax
ExtensionDtype.construct_array_type() -
Create an extension dtype from its accepted string representation.
Call syntax
ExtensionDtype.construct_from_string(string) -
Check whether a value or dtype specification matches the extension dtype class.
Call syntax
ExtensionDtype.is_dtype(dtype) pandas.api.extensions.ExtensionDtype.kindpropertypandas.api.extensions.ExtensionDtype.na_valuepropertypandas.api.extensions.ExtensionDtype.namepropertypandas.api.extensions.ExtensionDtype.namespropertypandas.api.extensions.ExtensionDtype.typeproperty-
Decorate a class to expose it under a named attribute on DataFrame objects.
Call syntax
api.extensions.register_dataframe_accessor(name) -
Register a custom ExtensionDtype so pandas can recognize it by name.
Call syntax
api.extensions.register_extension_dtype(cls) -
Decorate a class to expose it under a named attribute on Index objects.
Call syntax
api.extensions.register_index_accessor(name) -
Decorate a class to expose it under a named attribute on Series objects.
Call syntax
api.extensions.register_series_accessor(name) -
Normalize and validate an integer or boolean array indexer for a target array.
Call syntax
api.indexers.check_array_indexer(array, indexer) pandas.arrays.NumpyExtensionArrayclass
Testing, errors, and warnings (52)
pandas.errors.AbstractMethodErrorexceptionpandas.errors.AttributeConflictWarningexceptionpandas.errors.CategoricalConversionWarningexceptionpandas.errors.ChainedAssignmentErrorexceptionpandas.errors.ClosedFileErrorexceptionpandas.errors.CSSWarningexceptionpandas.errors.DatabaseErrorexceptionpandas.errors.DataErrorexceptionpandas.errors.DtypeWarningexceptionpandas.errors.DuplicateLabelErrorexceptionpandas.errors.EmptyDataErrorexceptionpandas.errors.IncompatibilityWarningexceptionpandas.errors.IncompatibleFrequencyexceptionpandas.errors.IndexingErrorexceptionpandas.errors.IntCastingNaNErrorexceptionpandas.errors.InvalidColumnNameexceptionpandas.errors.InvalidComparisonexceptionpandas.errors.InvalidIndexErrorexceptionpandas.errors.InvalidVersionexceptionpandas.errors.LossySetitemErrorexceptionpandas.errors.MergeErrorexceptionpandas.errors.NoBufferPresentexceptionpandas.errors.NullFrequencyErrorexceptionpandas.errors.NumbaUtilErrorexceptionpandas.errors.NumExprClobberingErrorexceptionpandas.errors.OptionErrorexceptionpandas.errors.OutOfBoundsDatetimeexceptionpandas.errors.OutOfBoundsTimedeltaexceptionpandas.errors.Pandas4Warningexceptionpandas.errors.Pandas5Warningexceptionpandas.errors.PandasChangeWarningexceptionpandas.errors.PandasDeprecationWarningexceptionpandas.errors.PandasFutureWarningexceptionpandas.errors.PandasPendingDeprecationWarningexceptionpandas.errors.ParserErrorexceptionpandas.errors.ParserWarningexceptionpandas.errors.PerformanceWarningexceptionpandas.errors.PossibleDataLossErrorexceptionpandas.errors.PossiblePrecisionLossexceptionpandas.errors.PyperclipExceptionexceptionpandas.errors.PyperclipWindowsExceptionexceptionpandas.errors.SpecificationErrorexceptionpandas.errors.UndefinedVariableErrorexceptionpandas.errors.UnsortedIndexErrorexceptionpandas.errors.UnsupportedFunctionCallexceptionpandas.errors.ValueLabelTypeMismatchexceptionpandas.show_versionsfunctionPrint environment and dependency versions for debugging or bug reports.
Call syntax
pd.show_versions([as_json])pandas.testfunctionRun the installed pandas test suite with pytest.
Call syntax
pd.test([extra_args, run_doctests])-
Raise AssertionError when two extension arrays fail the equality checks.
Call syntax
testing.assert_extension_array_equal(left, right) -
Compare expected and actual DataFrames in a test, with options for labels, dtypes and numeric tolerances.
Call syntax
testing.assert_frame_equal(left, right[, ...])Example
pd.testing.assert_frame_equal(orders, orders.copy()) -
Compare two indexes and raise AssertionError when the configured equality checks fail.
Call syntax
testing.assert_index_equal(left, right[, ...]) -
Compare two Series in a test, including their values, labels and configured metadata checks.
Call syntax
testing.assert_series_equal(left, right[, ...])Example
pd.testing.assert_series_equal(orders["units"], orders["units"].copy())
Typing aliases (71)
pandas.api.typing.aliasesmodulepandas.api.typing.aliases.AggFuncTypetypepandas.api.typing.aliases.AlignJointypepandas.api.typing.aliases.AnyAlltypepandas.api.typing.aliases.AnyArrayLiketypepandas.api.typing.aliases.ArrayLiketypepandas.api.typing.aliases.AstypeArgtypepandas.api.typing.aliases.Axestypepandas.api.typing.aliases.Axistypepandas.api.typing.aliases.ColspaceArgTypetypepandas.api.typing.aliases.CompressionOptionstypepandas.api.typing.aliases.CorrelationMethodtypepandas.api.typing.aliases.CSVEnginetypepandas.api.typing.aliases.DropKeeptypepandas.api.typing.aliases.Dtypetypepandas.api.typing.aliases.DtypeArgtypepandas.api.typing.aliases.DtypeBackendtypepandas.api.typing.aliases.DtypeObjtypepandas.api.typing.aliases.ExcelWriterIfSheetExiststypepandas.api.typing.aliases.ExcelWriterMergeCellstypepandas.api.typing.aliases.FilePathtypepandas.api.typing.aliases.FillnaOptionstypepandas.api.typing.aliases.FloatFormatTypetypepandas.api.typing.aliases.FormattersTypetypepandas.api.typing.aliases.FromDictOrienttypepandas.api.typing.aliases.HTMLFlavorstypepandas.api.typing.aliases.IgnoreRaisetypepandas.api.typing.aliases.IndexLabeltypepandas.api.typing.aliases.InterpolateOptionstypepandas.api.typing.aliases.IntervalClosedTypetypepandas.api.typing.aliases.IntervalLeftRighttypepandas.api.typing.aliases.JoinHowtypepandas.api.typing.aliases.JoinValidatetypepandas.api.typing.aliases.JSONEnginetypepandas.api.typing.aliases.JSONSerializabletypepandas.api.typing.aliases.ListLiketypepandas.api.typing.aliases.MergeHowtypepandas.api.typing.aliases.MergeValidatetypepandas.api.typing.aliases.NaPositiontypepandas.api.typing.aliases.NsmallestNlargestKeeptypepandas.api.typing.aliases.OpenFileErrorstypepandas.api.typing.aliases.Orderedtypepandas.api.typing.aliases.ParquetCompressionOptionstypepandas.api.typing.aliases.QuantileInterpolationtypepandas.api.typing.aliases.ReadBuffertypepandas.api.typing.aliases.ReadCsvBuffertypepandas.api.typing.aliases.ReadPickleBuffertypepandas.api.typing.aliases.ReindexMethodtypepandas.api.typing.aliases.Scalartypepandas.api.typing.aliases.ScalarIndexertypepandas.api.typing.aliases.SequenceIndexertypepandas.api.typing.aliases.SequenceNotStrtypepandas.api.typing.aliases.SliceTypetypepandas.api.typing.aliases.SortKindtypepandas.api.typing.aliases.StorageOptionstypepandas.api.typing.aliases.Suffixestypepandas.api.typing.aliases.TakeIndexertypepandas.api.typing.aliases.TimeAmbiguoustypepandas.api.typing.aliases.TimedeltaConvertibleTypestypepandas.api.typing.aliases.TimeGrouperOrigintypepandas.api.typing.aliases.TimeNonexistenttypepandas.api.typing.aliases.TimestampConvertibleTypestypepandas.api.typing.aliases.TimeUnittypepandas.api.typing.aliases.ToStataByteordertypepandas.api.typing.aliases.ToTimestampHowtypepandas.api.typing.aliases.UpdateJointypepandas.api.typing.aliases.UsecolsArgTypetypepandas.api.typing.aliases.WindowingRankTypetypepandas.api.typing.aliases.WriteBuffertypepandas.api.typing.aliases.WriteExcelBuffertypepandas.api.typing.aliases.XMLParserstype