doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
pandas.DataFrame.pipe DataFrame.pipe(func, *args, **kwargs)[source] Apply chainable functions that expect Series or DataFrames. Parameters func:function Function to apply to the Series/DataFrame. args, and kwargs are passed into func. Alternatively a (callable, data_keyword) tuple where data_keyword is a stri...
pandas.reference.api.pandas.dataframe.pipe
pandas.DataFrame.pivot DataFrame.pivot(index=None, columns=None, values=None)[source] Return reshaped DataFrame organized by given index / column values. Reshape data (produce a “pivot” table) based on column values. Uses unique values from specified index / columns to form axes of the resulting DataFrame. This fun...
pandas.reference.api.pandas.dataframe.pivot
pandas.DataFrame.pivot_table DataFrame.pivot_table(values=None, index=None, columns=None, aggfunc='mean', fill_value=None, margins=False, dropna=True, margins_name='All', observed=False, sort=True)[source] Create a spreadsheet-style pivot table as a DataFrame. The levels in the pivot table will be stored in MultiIn...
pandas.reference.api.pandas.dataframe.pivot_table
pandas.DataFrame.plot DataFrame.plot(*args, **kwargs)[source] Make plots of Series or DataFrame. Uses the backend specified by the option plotting.backend. By default, matplotlib is used. Parameters data:Series or DataFrame The object for which the method is called. x:label or position, default None Only ...
pandas.reference.api.pandas.dataframe.plot
pandas.DataFrame.plot.area DataFrame.plot.area(x=None, y=None, **kwargs)[source] Draw a stacked area plot. An area plot displays quantitative data visually. This function wraps the matplotlib area function. Parameters x:label or position, optional Coordinates for the X axis. By default uses the index. y:lab...
pandas.reference.api.pandas.dataframe.plot.area
pandas.DataFrame.plot.bar DataFrame.plot.bar(x=None, y=None, **kwargs)[source] Vertical bar plot. A bar plot is a plot that presents categorical data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows ...
pandas.reference.api.pandas.dataframe.plot.bar
pandas.DataFrame.plot.barh DataFrame.plot.barh(x=None, y=None, **kwargs)[source] Make a horizontal bar plot. A horizontal bar plot is a plot that presents quantitative data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One ...
pandas.reference.api.pandas.dataframe.plot.barh
pandas.DataFrame.plot.box DataFrame.plot.box(by=None, **kwargs)[source] Make a box plot of the DataFrame columns. A box plot is a method for graphically depicting groups of numerical data through their quartiles. The box extends from the Q1 to Q3 quartile values of the data, with a line at the median (Q2). The whis...
pandas.reference.api.pandas.dataframe.plot.box
pandas.DataFrame.plot.density DataFrame.plot.density(bw_method=None, ind=None, **kwargs)[source] Generate Kernel Density Estimate plot using Gaussian kernels. In statistics, kernel density estimation (KDE) is a non-parametric way to estimate the probability density function (PDF) of a random variable. This function...
pandas.reference.api.pandas.dataframe.plot.density
pandas.DataFrame.plot.hexbin DataFrame.plot.hexbin(x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs)[source] Generate a hexagonal binning plot. Generate a hexagonal binning plot of x versus y. If C is None (the default), this is a histogram of the number of occurrences of the observations at (x[i], y[i...
pandas.reference.api.pandas.dataframe.plot.hexbin
pandas.DataFrame.plot.hist DataFrame.plot.hist(by=None, bins=10, **kwargs)[source] Draw one histogram of the DataFrame’s columns. A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one matplotlib.axes.Axes...
pandas.reference.api.pandas.dataframe.plot.hist
pandas.DataFrame.plot.kde DataFrame.plot.kde(bw_method=None, ind=None, **kwargs)[source] Generate Kernel Density Estimate plot using Gaussian kernels. In statistics, kernel density estimation (KDE) is a non-parametric way to estimate the probability density function (PDF) of a random variable. This function uses Ga...
pandas.reference.api.pandas.dataframe.plot.kde
pandas.DataFrame.plot.line DataFrame.plot.line(x=None, y=None, **kwargs)[source] Plot Series or DataFrame as lines. This function is useful to plot lines using DataFrame’s values as coordinates. Parameters x:label or position, optional Allows plotting of one column versus another. If not specified, the index ...
pandas.reference.api.pandas.dataframe.plot.line
pandas.DataFrame.plot.pie DataFrame.plot.pie(**kwargs)[source] Generate a pie plot. A pie plot is a proportional representation of the numerical data in a column. This function wraps matplotlib.pyplot.pie() for the specified column. If no column reference is passed and subplots=True a pie plot is drawn for each num...
pandas.reference.api.pandas.dataframe.plot.pie
pandas.DataFrame.plot.scatter DataFrame.plot.scatter(x, y, s=None, c=None, **kwargs)[source] Create a scatter plot with varying marker point size and color. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. This kind of plot is useful to see comp...
pandas.reference.api.pandas.dataframe.plot.scatter
pandas.DataFrame.pop DataFrame.pop(item)[source] Return item and drop from frame. Raise KeyError if not found. Parameters item:label Label of column to be popped. Returns Series Examples >>> df = pd.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ...
pandas.reference.api.pandas.dataframe.pop
pandas.DataFrame.pow DataFrame.pow(other, axis='columns', level=None, fill_value=None)[source] Get Exponential power of dataframe and other, element-wise (binary operator pow). Equivalent to dataframe ** other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, ...
pandas.reference.api.pandas.dataframe.pow
pandas.DataFrame.prod DataFrame.prod(axis=None, skipna=True, level=None, numeric_only=None, min_count=0, **kwargs)[source] Return the product of the values over the requested axis. Parameters axis:{index (0), columns (1)} Axis for the function to be applied on. skipna:bool, default True Exclude NA/null va...
pandas.reference.api.pandas.dataframe.prod
pandas.DataFrame.product DataFrame.product(axis=None, skipna=True, level=None, numeric_only=None, min_count=0, **kwargs)[source] Return the product of the values over the requested axis. Parameters axis:{index (0), columns (1)} Axis for the function to be applied on. skipna:bool, default True Exclude NA/n...
pandas.reference.api.pandas.dataframe.product
pandas.DataFrame.quantile DataFrame.quantile(q=0.5, axis=0, numeric_only=True, interpolation='linear')[source] Return values at the given quantile over requested axis. Parameters q:float or array-like, default 0.5 (50% quantile) Value between 0 <= q <= 1, the quantile(s) to compute. axis:{0, 1, ‘index’, ‘co...
pandas.reference.api.pandas.dataframe.quantile
pandas.DataFrame.query DataFrame.query(expr, inplace=False, **kwargs)[source] Query the columns of a DataFrame with a boolean expression. Parameters expr:str The query string to evaluate. You can refer to variables in the environment by prefixing them with an ‘@’ character like @a + b. You can refer to column...
pandas.reference.api.pandas.dataframe.query
pandas.DataFrame.radd DataFrame.radd(other, axis='columns', level=None, fill_value=None)[source] Get Addition of dataframe and other, element-wise (binary operator radd). Equivalent to other + dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, add. Am...
pandas.reference.api.pandas.dataframe.radd
pandas.DataFrame.rank DataFrame.rank(axis=0, method='average', numeric_only=NoDefault.no_default, na_option='keep', ascending=True, pct=False)[source] Compute numerical data ranks (1 through n) along axis. By default, equal values are assigned a rank that is the average of the ranks of those values. Parameters ...
pandas.reference.api.pandas.dataframe.rank
pandas.DataFrame.rdiv DataFrame.rdiv(other, axis='columns', level=None, fill_value=None)[source] Get Floating division of dataframe and other, element-wise (binary operator rtruediv). Equivalent to other / dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse ver...
pandas.reference.api.pandas.dataframe.rdiv
pandas.DataFrame.reindex DataFrame.reindex(labels=None, index=None, columns=None, axis=None, method=None, copy=True, level=None, fill_value=nan, limit=None, tolerance=None)[source] Conform Series/DataFrame to new index with optional filling logic. Places NA/NaN in locations having no value in the previous index. A ...
pandas.reference.api.pandas.dataframe.reindex
pandas.DataFrame.reindex_like DataFrame.reindex_like(other, method=None, copy=True, limit=None, tolerance=None)[source] Return an object with matching indices as other object. Conform the object to the same index on all axes. Optional filling logic, placing NaN in locations having no value in the previous index. A ...
pandas.reference.api.pandas.dataframe.reindex_like
pandas.DataFrame.rename DataFrame.rename(mapper=None, *, index=None, columns=None, axis=None, copy=True, inplace=False, level=None, errors='ignore')[source] Alter axes labels. Function / dict values must be unique (1-to-1). Labels not contained in a dict / Series will be left as-is. Extra labels listed don’t throw ...
pandas.reference.api.pandas.dataframe.rename
pandas.DataFrame.rename_axis DataFrame.rename_axis(mapper=None, index=None, columns=None, axis=None, copy=True, inplace=False)[source] Set the name of the axis for the index or columns. Parameters mapper:scalar, list-like, optional Value to set the axis name attribute. index, columns:scalar, list-like, dict...
pandas.reference.api.pandas.dataframe.rename_axis
pandas.DataFrame.reorder_levels DataFrame.reorder_levels(order, axis=0)[source] Rearrange index levels using input order. May not drop or duplicate levels. Parameters order:list of int or list of str List representing new level order. Reference level by number (position) or by key (label). axis:{0 or ‘index...
pandas.reference.api.pandas.dataframe.reorder_levels
pandas.DataFrame.replace DataFrame.replace(to_replace=None, value=NoDefault.no_default, inplace=False, limit=None, regex=False, method=NoDefault.no_default)[source] Replace values given in to_replace with value. Values of the DataFrame are replaced with other values dynamically. This differs from updating with .loc...
pandas.reference.api.pandas.dataframe.replace
pandas.DataFrame.resample DataFrame.resample(rule, axis=0, closed=None, label=None, convention='start', kind=None, loffset=None, base=None, on=None, level=None, origin='start_day', offset=None)[source] Resample time-series data. Convenience method for frequency conversion and resampling of time series. The object m...
pandas.reference.api.pandas.dataframe.resample
pandas.DataFrame.reset_index DataFrame.reset_index(level=None, drop=False, inplace=False, col_level=0, col_fill='')[source] Reset the index, or a level of it. Reset the index of the DataFrame, and use the default one instead. If the DataFrame has a MultiIndex, this method can remove one or more levels. Parameters ...
pandas.reference.api.pandas.dataframe.reset_index
pandas.DataFrame.rfloordiv DataFrame.rfloordiv(other, axis='columns', level=None, fill_value=None)[source] Get Integer division of dataframe and other, element-wise (binary operator rfloordiv). Equivalent to other // dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With ...
pandas.reference.api.pandas.dataframe.rfloordiv
pandas.DataFrame.rmod DataFrame.rmod(other, axis='columns', level=None, fill_value=None)[source] Get Modulo of dataframe and other, element-wise (binary operator rmod). Equivalent to other % dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, mod. Amon...
pandas.reference.api.pandas.dataframe.rmod
pandas.DataFrame.rmul DataFrame.rmul(other, axis='columns', level=None, fill_value=None)[source] Get Multiplication of dataframe and other, element-wise (binary operator rmul). Equivalent to other * dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, m...
pandas.reference.api.pandas.dataframe.rmul
pandas.DataFrame.rolling DataFrame.rolling(window, min_periods=None, center=False, win_type=None, on=None, axis=0, closed=None, method='single')[source] Provide rolling window calculations. Parameters window:int, offset, or BaseIndexer subclass Size of the moving window. If an integer, the fixed number of obs...
pandas.reference.api.pandas.dataframe.rolling
pandas.DataFrame.round DataFrame.round(decimals=0, *args, **kwargs)[source] Round a DataFrame to a variable number of decimal places. Parameters decimals:int, dict, Series Number of decimal places to round each column to. If an int is given, round each column to the same number of places. Otherwise dict and S...
pandas.reference.api.pandas.dataframe.round
pandas.DataFrame.rpow DataFrame.rpow(other, axis='columns', level=None, fill_value=None)[source] Get Exponential power of dataframe and other, element-wise (binary operator rpow). Equivalent to other ** dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse versio...
pandas.reference.api.pandas.dataframe.rpow
pandas.DataFrame.rsub DataFrame.rsub(other, axis='columns', level=None, fill_value=None)[source] Get Subtraction of dataframe and other, element-wise (binary operator rsub). Equivalent to other - dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, sub....
pandas.reference.api.pandas.dataframe.rsub
pandas.DataFrame.rtruediv DataFrame.rtruediv(other, axis='columns', level=None, fill_value=None)[source] Get Floating division of dataframe and other, element-wise (binary operator rtruediv). Equivalent to other / dataframe, but with support to substitute a fill_value for missing data in one of the inputs. With rev...
pandas.reference.api.pandas.dataframe.rtruediv
pandas.DataFrame.sample DataFrame.sample(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None, ignore_index=False)[source] Return a random sample of items from an axis of object. You can use random_state for reproducibility. Parameters n:int, optional Number of items from axis to retur...
pandas.reference.api.pandas.dataframe.sample
pandas.DataFrame.select_dtypes DataFrame.select_dtypes(include=None, exclude=None)[source] Return a subset of the DataFrame’s columns based on the column dtypes. Parameters include, exclude:scalar or list-like A selection of dtypes or strings to be included/excluded. At least one of these parameters must be s...
pandas.reference.api.pandas.dataframe.select_dtypes
pandas.DataFrame.sem DataFrame.sem(axis=None, skipna=True, level=None, ddof=1, numeric_only=None, **kwargs)[source] Return unbiased standard error of the mean over requested axis. Normalized by N-1 by default. This can be changed using the ddof argument Parameters axis:{index (0), columns (1)} skipna:bool, de...
pandas.reference.api.pandas.dataframe.sem
pandas.DataFrame.set_axis DataFrame.set_axis(labels, axis=0, inplace=False)[source] Assign desired index to given axis. Indexes for column or row labels can be changed by assigning a list-like or Index. Parameters labels:list-like, Index The values for the new index. axis:{0 or ‘index’, 1 or ‘columns’}, def...
pandas.reference.api.pandas.dataframe.set_axis
pandas.DataFrame.set_flags DataFrame.set_flags(*, copy=False, allows_duplicate_labels=None)[source] Return a new object with updated flags. Parameters allows_duplicate_labels:bool, optional Whether the returned object allows duplicate labels. Returns Series or DataFrame The same type as the caller. ...
pandas.reference.api.pandas.dataframe.set_flags
pandas.DataFrame.set_index DataFrame.set_index(keys, drop=True, append=False, inplace=False, verify_integrity=False)[source] Set the DataFrame index using existing columns. Set the DataFrame index (row labels) using one or more existing columns or arrays (of the correct length). The index can replace the existing i...
pandas.reference.api.pandas.dataframe.set_index
pandas.DataFrame.shape propertyDataFrame.shape Return a tuple representing the dimensionality of the DataFrame. See also ndarray.shape Tuple of array dimensions. Examples >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}) >>> df.shape (2, 2) >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4], ... ...
pandas.reference.api.pandas.dataframe.shape
pandas.DataFrame.shift DataFrame.shift(periods=1, freq=None, axis=0, fill_value=NoDefault.no_default)[source] Shift index by desired number of periods with an optional time freq. When freq is not passed, shift the index without realigning the data. If freq is passed (in this case, the index must be date or datetime...
pandas.reference.api.pandas.dataframe.shift
pandas.DataFrame.size propertyDataFrame.size Return an int representing the number of elements in this object. Return the number of rows if Series. Otherwise return the number of rows times number of columns if DataFrame. See also ndarray.size Number of elements in the array. Examples >>> s = pd.Series({'a':...
pandas.reference.api.pandas.dataframe.size
pandas.DataFrame.skew DataFrame.skew(axis=NoDefault.no_default, skipna=True, level=None, numeric_only=None, **kwargs)[source] Return unbiased skew over requested axis. Normalized by N-1. Parameters axis:{index (0), columns (1)} Axis for the function to be applied on. skipna:bool, default True Exclude NA/n...
pandas.reference.api.pandas.dataframe.skew
pandas.DataFrame.slice_shift DataFrame.slice_shift(periods=1, axis=0)[source] Equivalent to shift without copying data. The shifted data will not include the dropped periods and the shifted axis will be smaller than the original. Deprecated since version 1.2.0: slice_shift is deprecated, use DataFrame/Series.shift...
pandas.reference.api.pandas.dataframe.slice_shift
pandas.DataFrame.sort_index DataFrame.sort_index(axis=0, level=None, ascending=True, inplace=False, kind='quicksort', na_position='last', sort_remaining=True, ignore_index=False, key=None)[source] Sort object by labels (along an axis). Returns a new DataFrame sorted by label if inplace argument is False, otherwise ...
pandas.reference.api.pandas.dataframe.sort_index
pandas.DataFrame.sort_values DataFrame.sort_values(by, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last', ignore_index=False, key=None)[source] Sort by the values along either axis. Parameters by:str or list of str Name or list of names to sort by. if axis is 0 or ‘index’ then by ma...
pandas.reference.api.pandas.dataframe.sort_values
pandas.DataFrame.sparse DataFrame.sparse()[source] DataFrame accessor for sparse data. New in version 0.25.0.
pandas.reference.api.pandas.dataframe.sparse
pandas.DataFrame.sparse.density DataFrame.sparse.density Ratio of non-sparse points to total (dense) data points.
pandas.reference.api.pandas.dataframe.sparse.density
pandas.DataFrame.sparse.from_spmatrix classmethodDataFrame.sparse.from_spmatrix(data, index=None, columns=None)[source] Create a new DataFrame from a scipy sparse matrix. New in version 0.25.0. Parameters data:scipy.sparse.spmatrix Must be convertible to csc format. index, columns:Index, optional Row an...
pandas.reference.api.pandas.dataframe.sparse.from_spmatrix
pandas.DataFrame.sparse.to_coo DataFrame.sparse.to_coo()[source] Return the contents of the frame as a sparse SciPy COO matrix. New in version 0.25.0. Returns coo_matrix:scipy.sparse.spmatrix If the caller is heterogeneous and contains booleans or objects, the result will be of dtype=object. See Notes. ...
pandas.reference.api.pandas.dataframe.sparse.to_coo
pandas.DataFrame.sparse.to_dense DataFrame.sparse.to_dense()[source] Convert a DataFrame with sparse values to dense. New in version 0.25.0. Returns DataFrame A DataFrame with the same values stored as dense arrays. Examples >>> df = pd.DataFrame({"A": pd.arrays.SparseArray([0, 1, 0])}) >>> df.sparse.to_...
pandas.reference.api.pandas.dataframe.sparse.to_dense
pandas.DataFrame.squeeze DataFrame.squeeze(axis=None)[source] Squeeze 1 dimensional axis objects into scalars. Series or DataFrames with a single element are squeezed to a scalar. DataFrames with a single column or a single row are squeezed to a Series. Otherwise the object is unchanged. This method is most useful ...
pandas.reference.api.pandas.dataframe.squeeze
pandas.DataFrame.stack DataFrame.stack(level=- 1, dropna=True)[source] Stack the prescribed level(s) from columns to index. Return a reshaped DataFrame or Series having a multi-level index with one or more new inner-most levels compared to the current DataFrame. The new inner-most levels are created by pivoting the...
pandas.reference.api.pandas.dataframe.stack
pandas.DataFrame.std DataFrame.std(axis=None, skipna=True, level=None, ddof=1, numeric_only=None, **kwargs)[source] Return sample standard deviation over requested axis. Normalized by N-1 by default. This can be changed using the ddof argument. Parameters axis:{index (0), columns (1)} skipna:bool, default Tru...
pandas.reference.api.pandas.dataframe.std
pandas.DataFrame.style propertyDataFrame.style Returns a Styler object. Contains methods for building a styled HTML representation of the DataFrame. See also io.formats.style.Styler Helps style a DataFrame or Series according to the data with HTML and CSS.
pandas.reference.api.pandas.dataframe.style
pandas.DataFrame.sub DataFrame.sub(other, axis='columns', level=None, fill_value=None)[source] Get Subtraction of dataframe and other, element-wise (binary operator sub). Equivalent to dataframe - other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, rsub. A...
pandas.reference.api.pandas.dataframe.sub
pandas.DataFrame.subtract DataFrame.subtract(other, axis='columns', level=None, fill_value=None)[source] Get Subtraction of dataframe and other, element-wise (binary operator sub). Equivalent to dataframe - other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse versio...
pandas.reference.api.pandas.dataframe.subtract
pandas.DataFrame.sum DataFrame.sum(axis=None, skipna=True, level=None, numeric_only=None, min_count=0, **kwargs)[source] Return the sum of the values over the requested axis. This is equivalent to the method numpy.sum. Parameters axis:{index (0), columns (1)} Axis for the function to be applied on. skipna:b...
pandas.reference.api.pandas.dataframe.sum
pandas.DataFrame.swapaxes DataFrame.swapaxes(axis1, axis2, copy=True)[source] Interchange axes and swap values axes appropriately. Returns y:same as input
pandas.reference.api.pandas.dataframe.swapaxes
pandas.DataFrame.swaplevel DataFrame.swaplevel(i=- 2, j=- 1, axis=0)[source] Swap levels i and j in a MultiIndex. Default is to swap the two innermost levels of the index. Parameters i, j:int or str Levels of the indices to be swapped. Can pass level name as string. axis:{0 or ‘index’, 1 or ‘columns’}, defa...
pandas.reference.api.pandas.dataframe.swaplevel
pandas.DataFrame.T propertyDataFrame.T
pandas.reference.api.pandas.dataframe.t
pandas.DataFrame.tail DataFrame.tail(n=5)[source] Return the last n rows. This function returns last n rows from the object based on position. It is useful for quickly verifying data, for example, after sorting or appending rows. For negative values of n, this function returns all rows except the first n rows, equi...
pandas.reference.api.pandas.dataframe.tail
pandas.DataFrame.take DataFrame.take(indices, axis=0, is_copy=None, **kwargs)[source] Return the elements in the given positional indices along an axis. This means that we are not indexing according to actual values in the index attribute of the object. We are indexing according to the actual position of the elemen...
pandas.reference.api.pandas.dataframe.take
pandas.DataFrame.to_clipboard DataFrame.to_clipboard(excel=True, sep=None, **kwargs)[source] Copy object to the system clipboard. Write a text representation of object to the system clipboard. This can be pasted into Excel, for example. Parameters excel:bool, default True Produce output in a csv format for ea...
pandas.reference.api.pandas.dataframe.to_clipboard
pandas.DataFrame.to_csv DataFrame.to_csv(path_or_buf=None, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', quoting=None, quotechar='"', line_terminator=None, chunksize=None, date_format=None, doublequote=True, escapechar=Non...
pandas.reference.api.pandas.dataframe.to_csv
pandas.DataFrame.to_dict DataFrame.to_dict(orient='dict', into=<class 'dict'>)[source] Convert the DataFrame to a dictionary. The type of the key-value pairs can be customized with the parameters (see below). Parameters orient:str {‘dict’, ‘list’, ‘series’, ‘split’, ‘records’, ‘index’} Determines the type of ...
pandas.reference.api.pandas.dataframe.to_dict
pandas.DataFrame.to_excel DataFrame.to_excel(excel_writer, sheet_name='Sheet1', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, startrow=0, startcol=0, engine=None, merge_cells=True, encoding=None, inf_rep='inf', verbose=True, freeze_panes=None, storage_options=None)[source] W...
pandas.reference.api.pandas.dataframe.to_excel
pandas.DataFrame.to_feather DataFrame.to_feather(path, **kwargs)[source] Write a DataFrame to the binary Feather format. Parameters path:str, path object, file-like object String, path object (implementing os.PathLike[str]), or file-like object implementing a binary write() function. If a string or a path, it...
pandas.reference.api.pandas.dataframe.to_feather
pandas.DataFrame.to_gbq DataFrame.to_gbq(destination_table, project_id=None, chunksize=None, reauth=False, if_exists='fail', auth_local_webserver=False, table_schema=None, location=None, progress_bar=True, credentials=None)[source] Write a DataFrame to a Google BigQuery table. This function requires the pandas-gbq ...
pandas.reference.api.pandas.dataframe.to_gbq
pandas.DataFrame.to_hdf DataFrame.to_hdf(path_or_buf, key, mode='a', complevel=None, complib=None, append=False, format=None, index=True, min_itemsize=None, nan_rep=None, dropna=None, data_columns=None, errors='strict', encoding='UTF-8')[source] Write the contained data to an HDF5 file using HDFStore. Hierarchical ...
pandas.reference.api.pandas.dataframe.to_hdf
pandas.DataFrame.to_html DataFrame.to_html(buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True, justify=None, max_rows=None, max_cols=None, show_dimensions=False, decimal='.', bold_rows=True, classes=None, escape=True, note...
pandas.reference.api.pandas.dataframe.to_html
pandas.DataFrame.to_json DataFrame.to_json(path_or_buf=None, orient=None, date_format=None, double_precision=10, force_ascii=True, date_unit='ms', default_handler=None, lines=False, compression='infer', index=True, indent=None, storage_options=None)[source] Convert the object to a JSON string. Note NaN’s and None w...
pandas.reference.api.pandas.dataframe.to_json
pandas.DataFrame.to_latex DataFrame.to_latex(buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True, bold_rows=False, column_format=None, longtable=None, escape=None, encoding=None, decimal='.', multicolumn=None, multicolumn_f...
pandas.reference.api.pandas.dataframe.to_latex
pandas.DataFrame.to_markdown DataFrame.to_markdown(buf=None, mode='wt', index=True, storage_options=None, **kwargs)[source] Print DataFrame in Markdown-friendly format. New in version 1.0.0. Parameters buf:str, Path or StringIO-like, optional, default None Buffer to write to. If None, the output is returned...
pandas.reference.api.pandas.dataframe.to_markdown
pandas.DataFrame.to_numpy DataFrame.to_numpy(dtype=None, copy=False, na_value=NoDefault.no_default)[source] Convert the DataFrame to a NumPy array. By default, the dtype of the returned array will be the common NumPy dtype of all types in the DataFrame. For example, if the dtypes are float16 and float32, the result...
pandas.reference.api.pandas.dataframe.to_numpy
pandas.DataFrame.to_parquet DataFrame.to_parquet(path=None, engine='auto', compression='snappy', index=None, partition_cols=None, storage_options=None, **kwargs)[source] Write a DataFrame to the binary parquet format. This function writes the dataframe as a parquet file. You can choose different parquet backends, a...
pandas.reference.api.pandas.dataframe.to_parquet
pandas.DataFrame.to_period DataFrame.to_period(freq=None, axis=0, copy=True)[source] Convert DataFrame from DatetimeIndex to PeriodIndex. Convert DataFrame from DatetimeIndex to PeriodIndex with desired frequency (inferred from index if not passed). Parameters freq:str, default Frequency of the PeriodIndex. ...
pandas.reference.api.pandas.dataframe.to_period
pandas.DataFrame.to_pickle DataFrame.to_pickle(path, compression='infer', protocol=5, storage_options=None)[source] Pickle (serialize) object to file. Parameters path:str File path where the pickled object will be stored. compression:str or dict, default ‘infer’ For on-the-fly compression of the output da...
pandas.reference.api.pandas.dataframe.to_pickle
pandas.DataFrame.to_records DataFrame.to_records(index=True, column_dtypes=None, index_dtypes=None)[source] Convert DataFrame to a NumPy record array. Index will be included as the first field of the record array if requested. Parameters index:bool, default True Include index in resulting record array, stored...
pandas.reference.api.pandas.dataframe.to_records
pandas.DataFrame.to_sql DataFrame.to_sql(name, con, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None, method=None)[source] Write records stored in a DataFrame to a SQL database. Databases supported by SQLAlchemy [1] are supported. Tables can be newly created, appended to, or o...
pandas.reference.api.pandas.dataframe.to_sql
pandas.DataFrame.to_stata DataFrame.to_stata(path, convert_dates=None, write_index=True, byteorder=None, time_stamp=None, data_label=None, variable_labels=None, version=114, convert_strl=None, compression='infer', storage_options=None, *, value_labels=None)[source] Export DataFrame object to Stata dta format. Write...
pandas.reference.api.pandas.dataframe.to_stata
pandas.DataFrame.to_string DataFrame.to_string(buf=None, columns=None, col_space=None, header=True, index=True, na_rep='NaN', formatters=None, float_format=None, sparsify=None, index_names=True, justify=None, max_rows=None, max_cols=None, show_dimensions=False, decimal='.', line_width=None, min_rows=None, max_colwidt...
pandas.reference.api.pandas.dataframe.to_string
pandas.DataFrame.to_timestamp DataFrame.to_timestamp(freq=None, how='start', axis=0, copy=True)[source] Cast to DatetimeIndex of timestamps, at beginning of period. Parameters freq:str, default frequency of PeriodIndex Desired frequency. how:{‘s’, ‘e’, ‘start’, ‘end’} Convention for converting period to t...
pandas.reference.api.pandas.dataframe.to_timestamp
pandas.DataFrame.to_xarray DataFrame.to_xarray()[source] Return an xarray object from the pandas object. Returns xarray.DataArray or xarray.Dataset Data in the pandas structure converted to Dataset if the object is a DataFrame, or a DataArray if the object is a Series. See also DataFrame.to_hdf Write Dat...
pandas.reference.api.pandas.dataframe.to_xarray
pandas.DataFrame.to_xml DataFrame.to_xml(path_or_buffer=None, index=True, root_name='data', row_name='row', na_rep=None, attr_cols=None, elem_cols=None, namespaces=None, prefix=None, encoding='utf-8', xml_declaration=True, pretty_print=True, parser='lxml', stylesheet=None, compression='infer', storage_options=None)[s...
pandas.reference.api.pandas.dataframe.to_xml
pandas.DataFrame.transform DataFrame.transform(func, axis=0, *args, **kwargs)[source] Call func on self producing a DataFrame with the same axis shape as self. Parameters func:function, str, list-like or dict-like Function to use for transforming the data. If a function, must either work when passed a DataFra...
pandas.reference.api.pandas.dataframe.transform
pandas.DataFrame.transpose DataFrame.transpose(*args, copy=False)[source] Transpose index and columns. Reflect the DataFrame over its main diagonal by writing rows as columns and vice-versa. The property T is an accessor to the method transpose(). Parameters *args:tuple, optional Accepted for compatibility wi...
pandas.reference.api.pandas.dataframe.transpose
pandas.DataFrame.truediv DataFrame.truediv(other, axis='columns', level=None, fill_value=None)[source] Get Floating division of dataframe and other, element-wise (binary operator truediv). Equivalent to dataframe / other, but with support to substitute a fill_value for missing data in one of the inputs. With revers...
pandas.reference.api.pandas.dataframe.truediv
pandas.DataFrame.truncate DataFrame.truncate(before=None, after=None, axis=None, copy=True)[source] Truncate a Series or DataFrame before and after some index value. This is a useful shorthand for boolean indexing based on index values above or below certain thresholds. Parameters before:date, str, int Trunca...
pandas.reference.api.pandas.dataframe.truncate
pandas.DataFrame.tshift DataFrame.tshift(periods=1, freq=None, axis=0)[source] Shift the time index, using the index’s frequency if available. Deprecated since version 1.1.0: Use shift instead. Parameters periods:int Number of periods to move, can be positive or negative. freq:DateOffset, timedelta, or st...
pandas.reference.api.pandas.dataframe.tshift
pandas.DataFrame.tz_convert DataFrame.tz_convert(tz, axis=0, level=None, copy=True)[source] Convert tz-aware axis to target time zone. Parameters tz:str or tzinfo object axis:the axis to convert level:int, str, default None If axis is a MultiIndex, convert a specific level. Otherwise must be None. copy:...
pandas.reference.api.pandas.dataframe.tz_convert
pandas.DataFrame.tz_localize DataFrame.tz_localize(tz, axis=0, level=None, copy=True, ambiguous='raise', nonexistent='raise')[source] Localize tz-naive index of a Series or DataFrame to target time zone. This operation localizes the Index. To localize the values in a timezone-naive Series, use Series.dt.tz_localize...
pandas.reference.api.pandas.dataframe.tz_localize
pandas.DataFrame.unstack DataFrame.unstack(level=- 1, fill_value=None)[source] Pivot a level of the (necessarily hierarchical) index labels. Returns a DataFrame having a new level of column labels whose inner-most level consists of the pivoted index labels. If the index is not a MultiIndex, the output will be a Ser...
pandas.reference.api.pandas.dataframe.unstack