Read general delimited file into DataFrame.
Also supports optionally iterating or breaking of the file into chunks.
Additional help can be found in the online docs for IO Tools.
Any valid string path is acceptable. The string could be a URL. Valid URL schemes include http, ftp, s3, gs, and file. For file URLs, a host is expected. A local file could be: file://localhost/path/to/table.csv.
If you want to pass in a path object, pandas accepts any os.PathLike.
By file-like object, we refer to objects with a read() method, such as a file handle (e.g. via builtin open function) or StringIO.
Delimiter to use. If sep is None, the C engine cannot automatically detect the separator, but the Python parsing engine can, meaning the latter will be used and automatically detect the separator by Python’s builtin sniffer tool, csv.Sniffer. In addition, separators longer than 1 character and different from '\s+' will be interpreted as regular expressions and will also force the use of the Python parsing engine. Note that regex delimiters are prone to ignoring quoted data. Regex example: '\r\t'.
Alias for sep.
Row number(s) to use as the column names, and the start of the data. Default behavior is to infer the column names: if no names are passed the behavior is identical to header=0 and column names are inferred from the first line of the file, if column names are passed explicitly then the behavior is identical to header=None. Explicitly pass header=0 to be able to replace existing names. The header can be a list of integers that specify row locations for a multi-index on the columns e.g. [0,1,3]. Intervening rows that are not specified will be skipped (e.g. 2 in this example is skipped). Note that this parameter ignores commented lines and empty lines if skip_blank_lines=True, so header=0 denotes the first line of data rather than the first line of the file.
List of column names to use. If the file contains a header row, then you should explicitly pass header=0 to override the column names. Duplicates in this list are not allowed.
Column(s) to use as the row labels of the DataFrame, either given as string name or column index. If a sequence of int / str is given, a MultiIndex is used.
Note: index_col=False can be used to force pandas to not use the first column as the index, e.g. when you have a malformed file with delimiters at the end of each line.
Return a subset of the columns. If list-like, all elements must either be positional (i.e. integer indices into the document columns) or strings that correspond to column names provided either by the user in names or inferred from the document header row(s). If names are given, the document header row(s) are not taken into account. For example, a valid list-like usecols parameter would be [0, 1, 2] or ['foo', 'bar', 'baz']. Element order is ignored, so usecols=[0, 1] is the same as [1, 0]. To instantiate a DataFrame from data with element order preserved use pd.read_csv(data, usecols=['foo', 'bar'])[['foo', 'bar']] for columns in ['foo', 'bar'] order or pd.read_csv(data, usecols=['foo', 'bar'])[['bar', 'foo']] for ['bar', 'foo'] order.
If callable, the callable function will be evaluated against the column names, returning names where the callable function evaluates to True. An example of a valid callable argument would be lambda x: x.upper() in
['AAA', 'BBB', 'DDD']. Using this parameter results in much faster parsing time and lower memory usage.
If the parsed data only contains one column then return a Series.
Deprecated since version 1.4.0: Append .squeeze("columns") to the call to read_table to squeeze the data.
Prefix to add to column numbers when no header, e.g. ‘X’ for X0, X1, …
Deprecated since version 1.4.0: Use a list comprehension on the DataFrame’s columns after calling read_csv.
Duplicate columns will be specified as ‘X’, ‘X.1’, …’X.N’, rather than ‘X’…’X’. Passing in False will cause data to be overwritten if there are duplicate names in the columns.
Data type for data or columns. E.g. {‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’} Use str or object together with suitable na_values settings to preserve and not interpret dtype. If converters are specified, they will be applied INSTEAD of dtype conversion.
Parser engine to use. The C and pyarrow engines are faster, while the python engine is currently more feature-complete. Multithreading is currently only supported by the pyarrow engine.
New in version 1.4.0: The “pyarrow” engine was added as an experimental engine, and some features are unsupported, or may not work correctly, with this engine.
Dict of functions for converting values in certain columns. Keys can either be integers or column labels.
Values to consider as True.
Values to consider as False.
Skip spaces after delimiter.
Line numbers to skip (0-indexed) or number of lines to skip (int) at the start of the file.
If callable, the callable function will be evaluated against the row indices, returning True if the row should be skipped and False otherwise. An example of a valid callable argument would be lambda x: x in [0, 2].
Number of lines at bottom of file to skip (Unsupported with engine=’c’).
Number of rows of file to read. Useful for reading pieces of large files.
Additional strings to recognize as NA/NaN. If dict passed, specific per-column NA values. By default the following values are interpreted as NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’, ‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’, ‘nan’, ‘null’.
Whether or not to include the default NaN values when parsing the data. Depending on whether na_values is passed in, the behavior is as follows:
If keep_default_na is True, and na_values are specified, na_values is appended to the default NaN values used for parsing.
If keep_default_na is True, and na_values are not specified, only the default NaN values are used for parsing.
If keep_default_na is False, and na_values are specified, only the NaN values specified na_values are used for parsing.
If keep_default_na is False, and na_values are not specified, no strings will be parsed as NaN.
Note that if na_filter is passed in as False, the keep_default_na and na_values parameters will be ignored.
Detect missing value markers (empty strings and the value of na_values). In data without any NAs, passing na_filter=False can improve the performance of reading a large file.
Indicate number of NA values placed in non-numeric columns.
If True, skip over blank lines rather than interpreting as NaN values.
The behavior is as follows:
boolean. If True -> try parsing the index.
list of int or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3 each as a separate date column.
list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as a single date column.
dict, e.g. {‘foo’ : [1, 3]} -> parse columns 1, 3 as date and call result ‘foo’
If a column or index cannot be represented as an array of datetimes, say because of an unparsable value or a mixture of timezones, the column or index will be returned unaltered as an object data type. For non-standard datetime parsing, use pd.to_datetime after pd.read_csv. To parse an index or column with a mixture of timezones, specify date_parser to be a partially-applied pandas.to_datetime() with utc=True. See Parsing a CSV with mixed timezones for more.
Note: A fast-path exists for iso8601-formatted dates.
If True and parse_dates is enabled, pandas will attempt to infer the format of the datetime strings in the columns, and if it can be inferred, switch to a faster method of parsing them. In some cases this can increase the parsing speed by 5-10x.
If True and parse_dates specifies combining multiple columns then keep the original columns.
Function to use for converting a sequence of string columns to an array of datetime instances. The default uses dateutil.parser.parser to do the conversion. Pandas will try to call date_parser in three different ways, advancing to the next if an exception occurs: 1) Pass one or more arrays (as defined by parse_dates) as arguments; 2) concatenate (row-wise) the string values from the columns defined by parse_dates into a single array and pass that; and 3) call date_parser once for each row using one or more strings (corresponding to the columns defined by parse_dates) as arguments.
DD/MM format dates, international and European format.
If True, use a cache of unique, converted dates to apply the datetime conversion. May produce significant speed-up when parsing duplicate date strings, especially ones with timezone offsets.
New in version 0.25.0.
Return TextFileReader object for iteration or getting chunks with get_chunk().
Changed in version 1.2: TextFileReader is a context manager.
Return TextFileReader object for iteration. See the IO Tools docs for more information on iterator and chunksize.
Changed in version 1.2: TextFileReader is a context manager.
For on-the-fly decompression of on-disk data. If ‘infer’ and ‘%s’ is path-like, then detect compression from the following extensions: ‘.gz’, ‘.bz2’, ‘.zip’, ‘.xz’, or ‘.zst’ (otherwise no compression). If using ‘zip’, the ZIP file must contain only one data file to be read in. Set to None for no decompression. Can also be a dict with key 'method' set to one of {'zip', 'gzip', 'bz2', 'zstd'} and other key-value pairs are forwarded to zipfile.ZipFile, gzip.GzipFile, bz2.BZ2File, or zstandard.ZstdDecompressor, respectively. As an example, the following could be passed for Zstandard decompression using a custom compression dictionary: compression={'method': 'zstd', 'dict_data': my_compression_dict}.
Changed in version 1.4.0: Zstandard support.
Thousands separator.
Character to recognize as decimal point (e.g. use ‘,’ for European data).
Character to break file into lines. Only valid with C parser.
The character used to denote the start and end of a quoted item. Quoted items can include the delimiter and it will be ignored.
Control field quoting behavior per csv.QUOTE_* constants. Use one of QUOTE_MINIMAL (0), QUOTE_ALL (1), QUOTE_NONNUMERIC (2) or QUOTE_NONE (3).
When quotechar is specified and quoting is not QUOTE_NONE, indicate whether or not to interpret two consecutive quotechar elements INSIDE a field as a single quotechar element.
One-character string used to escape other characters.
Indicates remainder of line should not be parsed. If found at the beginning of a line, the line will be ignored altogether. This parameter must be a single character. Like empty lines (as long as skip_blank_lines=True), fully commented lines are ignored by the parameter header but not by skiprows. For example, if comment='#', parsing #empty\na,b,c\n1,2,3 with header=0 will result in ‘a,b,c’ being treated as the header.
Encoding to use for UTF when reading/writing (ex. ‘utf-8’). List of Python standard encodings .
Changed in version 1.2: When encoding is None, errors="replace" is passed to open(). Otherwise, errors="strict" is passed to open(). This behavior was previously only the case for engine="python".
Changed in version 1.3.0: encoding_errors is a new argument. encoding has no longer an influence on how encoding errors are handled.
How encoding errors are treated. List of possible values .
New in version 1.3.0.
If provided, this parameter will override values (default or not) for the following parameters: delimiter, doublequote, escapechar, skipinitialspace, quotechar, and quoting. If it is necessary to override values, a ParserWarning will be issued. See csv.Dialect documentation for more details.
Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no DataFrame will be returned. If False, then these “bad lines” will be dropped from the DataFrame that is returned.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon encountering a bad line instead.
If error_bad_lines is False, and warn_bad_lines is True, a warning for each “bad line” will be output.
Deprecated since version 1.3.0: The on_bad_lines parameter should be used instead to specify behavior upon encountering a bad line instead.
Specifies what to do upon encountering a bad line (a line with too many fields). Allowed values are :
‘error’, raise an Exception when a bad line is encountered.
‘warn’, raise a warning when a bad line is encountered and skip that line.
‘skip’, skip bad lines without raising or warning when they are encountered.
New in version 1.3.0:
callable, function with signature (bad_line: list[str]) -> list[str] | None that will process a single bad line. bad_line is a list of strings split by the sep. If the function returns None`, the bad line will be ignored.
If the function returns a new list of strings with more elements than
expected, a ``ParserWarning will be emitted while dropping extra elements. Only supported when engine="python"
New in version 1.4.0.
Specifies whether or not whitespace (e.g. ' ' or '    ') will be used as the sep. Equivalent to setting sep='\s+'. If this option is set to True, nothing should be passed in for the delimiter parameter.
Internally process the file in chunks, resulting in lower memory use while parsing, but possibly mixed type inference. To ensure no mixed types either set False, or specify the type with the dtype parameter. Note that the entire file is read into a single DataFrame regardless, use the chunksize or iterator parameter to return the data in chunks. (Only valid with C parser).
If a filepath is provided for filepath_or_buffer, map the file object directly onto memory and access the data directly from there. Using this option can improve performance because there is no longer any I/O overhead.
Specifies which converter the C engine should use for floating-point values. The options are None or ‘high’ for the ordinary converter, ‘legacy’ for the original lower precision pandas converter, and ‘round_trip’ for the round-trip converter.
Changed in version 1.2.
Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec. Please see fsspec and urllib for more details.
New in version 1.2.
A comma-separated values (csv) file is returned as two-dimensional data structure with labeled axes.
See also
Write DataFrame to a comma-separated values (csv) file.
Read a comma-separated values (csv) file into DataFrame.
Read a table of fixed-width formatted lines into DataFrame.
Examples


Read XML document into a DataFrame object.
New in version 1.3.0.
String, path object (implementing os.PathLike[str]), or file-like object implementing a read() function. The string can be any valid XML string or a path. The string can further be a URL. Valid URL schemes include http, ftp, s3, and file.
The XPath to parse required set of nodes for migration to DataFrame. XPath should return a collection of elements and not a single element. Note: The etree parser supports limited XPath expressions. For more complex XPath, use lxml which requires installation.
The namespaces defined in XML document as dicts with key being namespace prefix and value the URI. There is no need to include all namespaces in XML, only the ones used in xpath expression. Note: if XML document uses default namespace denoted as xmlns=’<URI>’ without a prefix, you must assign any temporary namespace prefix such as ‘doc’ to the URI in order to parse underlying nodes and/or attributes. For example,
Parse only the child elements at the specified xpath. By default, all child elements and non-empty text nodes are returned.
Parse only the attributes at the specified xpath. By default, all attributes are returned.
Column names for DataFrame of parsed XML data. Use this parameter to rename original element names and distinguish same named elements.
Encoding of XML document.
Parser module to use for retrieval of data. Only ‘lxml’ and ‘etree’ are supported. With ‘lxml’ more complex XPath searches and ability to use XSLT stylesheet are supported.
A URL, file-like object, or a raw string containing an XSLT script. This stylesheet should flatten complex, deeply nested XML documents for easier parsing. To use this feature you must have lxml module installed and specify ‘lxml’ as parser. The xpath must reference nodes of transformed XML document generated after XSLT transformation and not the original XML document. Only XSLT 1.0 scripts and not later versions is currently supported.
For on-the-fly decompression of on-disk data. If ‘infer’ and ‘path_or_buffer’ is path-like, then detect compression from the following extensions: ‘.gz’, ‘.bz2’, ‘.zip’, ‘.xz’, or ‘.zst’ (otherwise no compression). If using ‘zip’, the ZIP file must contain only one data file to be read in. Set to None for no decompression. Can also be a dict with key 'method' set to one of {'zip', 'gzip', 'bz2', 'zstd'} and other key-value pairs are forwarded to zipfile.ZipFile, gzip.GzipFile, bz2.BZ2File, or zstandard.ZstdDecompressor, respectively. As an example, the following could be passed for Zstandard decompression using a custom compression dictionary: compression={'method': 'zstd', 'dict_data': my_compression_dict}.
Changed in version 1.4.0: Zstandard support.
Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec. Please see fsspec and urllib for more details.
A DataFrame.
See also
Convert a JSON string to pandas object.
Read HTML tables into a list of DataFrame objects.
Notes
This method is best designed to import shallow XML documents in following format which is the ideal fit for the two-dimensions of a DataFrame (row by column).
As a file format, XML documents can be designed any way including layout of elements and attributes as long as it conforms to W3C specifications. Therefore, this method is a convenience handler for a specific flatter design and not all possible XML structures.
However, for more complex XML documents, stylesheet allows you to temporarily redesign original document with XSLT (a special purpose language) for a flatter version for migration to a DataFrame.
This function will always return a single DataFrame or raise exceptions due to issues with XML document, xpath, or other parameters.
Examples


Reset one or more options to their default value.
Pass “all” as argument to reset all options.
Available options:
compute.[use_bottleneck, use_numba, use_numexpr]
display.[chop_threshold, colheader_justify, column_space, date_dayfirst, date_yearfirst, encoding, expand_frame_repr, float_format]
display.html.[border, table_schema, use_mathjax]
display.[large_repr]
display.latex.[escape, longtable, multicolumn, multicolumn_format, multirow, repr]
display.[max_categories, max_columns, max_colwidth, max_dir_items, max_info_columns, max_info_rows, max_rows, max_seq_items, memory_usage, min_rows, multi_sparse, notebook_repr_html, pprint_nest_depth, precision, show_dimensions]
display.unicode.[ambiguous_as_wide, east_asian_width]
display.[width]
io.excel.ods.[reader, writer]
io.excel.xls.[reader, writer]
io.excel.xlsb.[reader]
io.excel.xlsm.[reader, writer]
io.excel.xlsx.[reader, writer]
io.hdf.[default_format, dropna_table]
io.parquet.[engine]
io.sql.[engine]
mode.[chained_assignment, data_manager, sim_interactive, string_storage, use_inf_as_na, use_inf_as_null]
plotting.[backend]
plotting.matplotlib.[register_converters]
styler.format.[decimal, escape, formatter, na_rep, precision, thousands]
styler.html.[mathjax]
styler.latex.[environment, hrules, multicol_align, multirow_align]
styler.render.[encoding, max_columns, max_elements, max_rows, repr]
styler.sparse.[columns, index]
If specified only options matching prefix* will be reset. Note: partial matches are supported for convenience, but unless you use the full option name (e.g. x.y.z.option_name), your code may break in future versions if new options with similar names are introduced.
Notes
The available options with its descriptions:
Use the bottleneck library to accelerate if it is installed, the default is True Valid values: False,True [default: True] [currently: True]
Use the numba engine option for select operations if it is installed, the default is False Valid values: False,True [default: False] [currently: False]
Use the numexpr library to accelerate computation if it is installed, the default is True Valid values: False,True [default: True] [currently: True]
if set to a float value, all float values smaller then the given threshold will be displayed as exactly 0 by repr and friends. [default: None] [currently: None]
Controls the justification of column headers. used by DataFrameFormatter. [default: right] [currently: right]
[default: 12] [currently: 12]
When True, prints and parses dates with the day first, eg 20/01/2005 [default: False] [currently: False]
When True, prints and parses dates with the year first, eg 2005/01/20 [default: False] [currently: False]
Defaults to the detected encoding of the console. Specifies the encoding to be used for strings returned by to_string, these are generally strings meant to be displayed on the console. [default: utf-8] [currently: utf-8]
Whether to print out the full DataFrame repr for wide DataFrames across multiple lines, max_columns is still respected, but the output will wrap-around across multiple “pages” if its width exceeds display.width. [default: True] [currently: True]
The callable should accept a floating point number and return a string with the desired format of the number. This is used in some places like SeriesFormatter. See formats.format.EngFormatter for an example. [default: None] [currently: None]
A border=value attribute is inserted in the <table> tag for the DataFrame HTML repr. [default: 1] [currently: 1]
Whether to publish a Table Schema representation for frontends that support it. (default: False) [default: False] [currently: False]
When True, Jupyter notebook will process table contents using MathJax, rendering mathematical expressions enclosed by the dollar symbol. (default: True) [default: True] [currently: True]
For DataFrames exceeding max_rows/max_cols, the repr (and HTML repr) can show a truncated table (the default from 0.13), or switch to the view from df.info() (the behaviour in earlier versions of pandas). [default: truncate] [currently: truncate]
This specifies if the to_latex method of a Dataframe uses escapes special characters. Valid values: False,True [default: True] [currently: True]
This specifies if the to_latex method of a Dataframe uses the longtable format. Valid values: False,True [default: False] [currently: False]
This specifies if the to_latex method of a Dataframe uses multicolumns to pretty-print MultiIndex columns. Valid values: False,True [default: True] [currently: True]
This specifies if the to_latex method of a Dataframe uses multicolumns to pretty-print MultiIndex columns. Valid values: False,True [default: l] [currently: l]
This specifies if the to_latex method of a Dataframe uses multirows to pretty-print MultiIndex rows. Valid values: False,True [default: False] [currently: False]
Whether to produce a latex DataFrame representation for jupyter environments that support it. (default: False) [default: False] [currently: False]
This sets the maximum number of categories pandas should output when printing out a Categorical or a Series of dtype “category”. [default: 8] [currently: 8]
If max_cols is exceeded, switch to truncate view. Depending on large_repr, objects are either centrally truncated or printed as a summary view. ‘None’ value means unlimited.
In case python/IPython is running in a terminal and large_repr equals ‘truncate’ this can be set to 0 and pandas will auto-detect the width of the terminal and print a truncated object which fits the screen width. The IPython notebook, IPython qtconsole, or IDLE do not run in a terminal and hence it is not possible to do correct auto-detection. [default: 0] [currently: 0]
The maximum width in characters of a column in the repr of a pandas data structure. When the column overflows, a “…” placeholder is embedded in the output. A ‘None’ value means unlimited. [default: 50] [currently: 50]
The number of items that will be added to dir(…). ‘None’ value means unlimited. Because dir is cached, changing this option will not immediately affect already existing dataframes until a column is deleted or added.
This is for instance used to suggest columns from a dataframe to tab completion. [default: 100] [currently: 100]
max_info_columns is used in DataFrame.info method to decide if per column information will be printed. [default: 100] [currently: 100]
df.info() will usually show null-counts for each column. For large frames this can be quite slow. max_info_rows and max_info_cols limit this null check only to frames with smaller dimensions than specified. [default: 1690785] [currently: 1690785]
If max_rows is exceeded, switch to truncate view. Depending on large_repr, objects are either centrally truncated or printed as a summary view. ‘None’ value means unlimited.
In case python/IPython is running in a terminal and large_repr equals ‘truncate’ this can be set to 0 and pandas will auto-detect the height of the terminal and print a truncated object which fits the screen height. The IPython notebook, IPython qtconsole, or IDLE do not run in a terminal and hence it is not possible to do correct auto-detection. [default: 60] [currently: 60]
When pretty-printing a long sequence, no more then max_seq_items will be printed. If items are omitted, they will be denoted by the addition of “…” to the resulting string.
If set to None, the number of items to be printed is unlimited. [default: 100] [currently: 100]
This specifies if the memory usage of a DataFrame should be displayed when df.info() is called. Valid values True,False,’deep’ [default: True] [currently: True]
The numbers of rows to show in a truncated view (when max_rows is exceeded). Ignored when max_rows is set to None or 0. When set to None, follows the value of max_rows. [default: 10] [currently: 10]
“sparsify” MultiIndex display (don’t display repeated elements in outer levels within groups) [default: True] [currently: True]
When True, IPython notebook will use html representation for pandas objects (if it is available). [default: True] [currently: True]
Controls the number of nested levels to process when pretty-printing [default: 3] [currently: 3]
Floating point output precision in terms of number of places after the decimal, for regular formatting as well as scientific notation. Similar to precision in numpy.set_printoptions(). [default: 6] [currently: 6]
Whether to print out dimensions at the end of DataFrame repr. If ‘truncate’ is specified, only print out the dimensions if the frame is truncated (e.g. not display all rows and/or columns) [default: truncate] [currently: truncate]
Whether to use the Unicode East Asian Width to calculate the display text width. Enabling this may affect to the performance (default: False) [default: False] [currently: False]
Whether to use the Unicode East Asian Width to calculate the display text width. Enabling this may affect to the performance (default: False) [default: False] [currently: False]
Width of the display in characters. In case python/IPython is running in a terminal this can be set to None and pandas will correctly auto-detect the width. Note that the IPython notebook, IPython qtconsole, or IDLE do not run in a terminal and hence it is not possible to correctly detect the width. [default: 80] [currently: 80]
The default Excel reader engine for ‘ods’ files. Available options: auto, odf. [default: auto] [currently: auto]
The default Excel writer engine for ‘ods’ files. Available options: auto, odf. [default: auto] [currently: auto]
The default Excel reader engine for ‘xls’ files. Available options: auto, xlrd. [default: auto] [currently: auto]
The default Excel writer engine for ‘xls’ files. Available options: auto, xlwt. [default: auto] [currently: auto] (Deprecated, use `` instead.)
The default Excel reader engine for ‘xlsb’ files. Available options: auto, pyxlsb. [default: auto] [currently: auto]
The default Excel reader engine for ‘xlsm’ files. Available options: auto, xlrd, openpyxl. [default: auto] [currently: auto]
The default Excel writer engine for ‘xlsm’ files. Available options: auto, openpyxl. [default: auto] [currently: auto]
The default Excel reader engine for ‘xlsx’ files. Available options: auto, xlrd, openpyxl. [default: auto] [currently: auto]
The default Excel writer engine for ‘xlsx’ files. Available options: auto, openpyxl, xlsxwriter. [default: auto] [currently: auto]
default format writing format, if None, then put will default to ‘fixed’ and append will default to ‘table’ [default: None] [currently: None]
drop ALL nan rows when appending to a table [default: False] [currently: False]
The default parquet reader/writer engine. Available options: ‘auto’, ‘pyarrow’, ‘fastparquet’, the default is ‘auto’ [default: auto] [currently: auto]
The default sql reader/writer engine. Available options: ‘auto’, ‘sqlalchemy’, the default is ‘auto’ [default: auto] [currently: auto]
Raise an exception, warn, or no action if trying to use chained assignment, The default is warn [default: warn] [currently: warn]
Internal data manager type; can be “block” or “array”. Defaults to “block”, unless overridden by the ‘PANDAS_DATA_MANAGER’ environment variable (needs to be set before pandas is imported). [default: block] [currently: block]
Whether to simulate interactive mode for purposes of testing [default: False] [currently: False]
The default storage for StringDtype. [default: python] [currently: python]
True means treat None, NaN, INF, -INF as NA (old way), False means None and NaN are null, but INF, -INF are not NA (new way). [default: False] [currently: False]
use_inf_as_null had been deprecated and will be removed in a future version. Use use_inf_as_na instead. [default: False] [currently: False] (Deprecated, use mode.use_inf_as_na instead.)
The plotting backend to use. The default value is “matplotlib”, the backend provided with pandas. Other backends can be specified by providing the name of the module that implements the backend. [default: matplotlib] [currently: matplotlib]
Whether to register converters with matplotlib’s units registry for dates, times, datetimes, and Periods. Toggling to False will remove the converters, restoring any converters that pandas overwrote. [default: auto] [currently: auto]
The character representation for the decimal separator for floats and complex. [default: .] [currently: .]
Whether to escape certain characters according to the given context; html or latex. [default: None] [currently: None]
A formatter object to be used as default within Styler.format. [default: None] [currently: None]
The string representation for values identified as missing. [default: None] [currently: None]
The precision for floats and complex numbers. [default: 6] [currently: 6]
The character representation for thousands separator for floats, int and complex. [default: None] [currently: None]
If False will render special CSS classes to table attributes that indicate Mathjax will not be used in Jupyter Notebook. [default: True] [currently: True]
The environment to replace \begin{table}. If “longtable” is used results in a specific longtable environment format. [default: None] [currently: None]
Whether to add horizontal rules on top and bottom and below the headers. [default: False] [currently: False]
The specifier for horizontal alignment of sparsified LaTeX multicolumns. Pipe decorators can also be added to non-naive values to draw vertical rules, e.g. “|r” will draw a rule on the left side of right aligned merged cells. [default: r] [currently: r]
The specifier for vertical alignment of sparsified LaTeX multirows. [default: c] [currently: c]
The encoding used for output HTML and LaTeX files. [default: utf-8] [currently: utf-8]
The maximum number of columns that will be rendered. May still be reduced to satsify max_elements, which takes precedence. [default: None] [currently: None]
The maximum number of data-cell (<td>) elements that will be rendered before trimming will occur over columns, rows or both if needed. [default: 262144] [currently: 262144]
The maximum number of rows that will be rendered. May still be reduced to satsify max_elements, which takes precedence. [default: None] [currently: None]
Determine which output to use in Jupyter Notebook in {“html”, “latex”}. [default: html] [currently: html]
Whether to sparsify the display of hierarchical columns. Setting to False will display each explicit level element in a hierarchical key for each column. [default: True] [currently: True]
Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. [default: True] [currently: True]


One-dimensional ndarray with axis labels (including time series).
Labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Statistical methods from ndarray have been overridden to automatically exclude missing data (currently represented as NaN).
Operations between Series (+, -, /, *, **) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes.
Contains data stored in Series. If data is a dict, argument order is maintained.
Values must be hashable and have the same length as data. Non-unique index values are allowed. Will default to RangeIndex (0, 1, 2, …, n) if not provided. If data is dict-like and index is None, then the keys in the data are used as the index. If the index is not None, the resulting Series is reindexed with the index values.
Data type for the output Series. If not specified, this will be inferred from data. See the user guide for more usages.
The name to give to the Series.
Copy input data. Only affects Series or 1d ndarray input. See examples.
Examples
Constructing Series from a dictionary with an Index specified
The keys of the dictionary match with the Index values, hence the Index values have no effect.
Note that the Index is first build with the keys from the dictionary. After this the Series is reindexed with the given Index values, hence we get all NaN as a result.
Constructing Series from a list with copy=False.
Due to input data type the Series has a copy of the original data even though copy=False, so the data is unchanged.
Constructing Series from a 1d ndarray with copy=False.
Due to input data type the Series has a view on the original data, so the data is changed as well.
Attributes
T
Return the transpose, which is by definition self.
array
The ExtensionArray of the data backing this Series or Index.
at
Access a single value for a row/column label pair.
attrs
Dictionary of global attributes of this dataset.
axes
Return a list of the row axis labels.
dtype
Return the dtype object of the underlying data.
dtypes
Return the dtype object of the underlying data.
flags
Get the properties associated with this pandas object.
hasnans
Return True if there are any NaNs.
iat
Access a single value for a row/column pair by integer position.
iloc
Purely integer-location based indexing for selection by position.
index
The index (axis labels) of the Series.
is_monotonic
Return boolean if values in the object are monotonic_increasing.
is_monotonic_decreasing
Return boolean if values in the object are monotonic_decreasing.
is_monotonic_increasing
Alias for is_monotonic.
is_unique
Return boolean if values in the object are unique.
loc
Access a group of rows and columns by label(s) or a boolean array.
name
Return the name of the Series.
nbytes
Return the number of bytes in the underlying data.
ndim
Number of dimensions of the underlying data, by definition 1.
shape
Return a tuple of the shape of the underlying data.
size
Return the number of elements in the underlying data.
values
Return Series as ndarray or ndarray-like depending on the dtype.
empty
Methods
abs()
Return a Series/DataFrame with absolute numeric value of each element.
add(other[, level, fill_value, axis])
Return Addition of series and other, element-wise (binary operator add).
add_prefix(prefix)
Prefix labels with string prefix.
add_suffix(suffix)
Suffix labels with string suffix.
agg([func, axis])
Aggregate using one or more operations over the specified axis.
aggregate([func, axis])
Aggregate using one or more operations over the specified axis.
align(other[, join, axis, level, copy, ...])
Align two objects on their axes with the specified join method.
all([axis, bool_only, skipna, level])
Return whether all elements are True, potentially over an axis.
any([axis, bool_only, skipna, level])
Return whether any element is True, potentially over an axis.
append(to_append[, ignore_index, ...])
Concatenate two or more Series.
apply(func[, convert_dtype, args])
Invoke function on values of Series.
argmax([axis, skipna])
Return int position of the largest value in the Series.
argmin([axis, skipna])
Return int position of the smallest value in the Series.
argsort([axis, kind, order])
Return the integer indices that would sort the Series values.
asfreq(freq[, method, how, normalize, ...])
Convert time series to specified frequency.
asof(where[, subset])
Return the last row(s) without any NaNs before where.
astype(dtype[, copy, errors])
Cast a pandas object to a specified dtype dtype.
at_time(time[, asof, axis])
Select values at particular time of day (e.g., 9:30AM).
autocorr([lag])
Compute the lag-N autocorrelation.
backfill([axis, inplace, limit, downcast])
Synonym for DataFrame.fillna() with method='bfill'.
between(left, right[, inclusive])
Return boolean Series equivalent to left <= series <= right.
between_time(start_time, end_time[, ...])
Select values between particular times of the day (e.g., 9:00-9:30 AM).
bfill([axis, inplace, limit, downcast])
Synonym for DataFrame.fillna() with method='bfill'.
bool()
Return the bool of a single element Series or DataFrame.
cat
alias of pandas.core.arrays.categorical.CategoricalAccessor
clip([lower, upper, axis, inplace])
Trim values at input threshold(s).
combine(other, func[, fill_value])
Combine the Series with a Series or scalar according to func.
combine_first(other)
Update null elements with value in the same location in 'other'.
compare(other[, align_axis, keep_shape, ...])
Compare to another Series and show the differences.
convert_dtypes([infer_objects, ...])
Convert columns to best possible dtypes using dtypes supporting pd.NA.
copy([deep])
Make a copy of this object's indices and data.
corr(other[, method, min_periods])
Compute correlation with other Series, excluding missing values.
count([level])
Return number of non-NA/null observations in the Series.
cov(other[, min_periods, ddof])
Compute covariance with Series, excluding missing values.
cummax([axis, skipna])
Return cumulative maximum over a DataFrame or Series axis.
cummin([axis, skipna])
Return cumulative minimum over a DataFrame or Series axis.
cumprod([axis, skipna])
Return cumulative product over a DataFrame or Series axis.
cumsum([axis, skipna])
Return cumulative sum over a DataFrame or Series axis.
describe([percentiles, include, exclude, ...])
Generate descriptive statistics.
diff([periods])
First discrete difference of element.
div(other[, level, fill_value, axis])
Return Floating division of series and other, element-wise (binary operator truediv).
divide(other[, level, fill_value, axis])
Return Floating division of series and other, element-wise (binary operator truediv).
divmod(other[, level, fill_value, axis])
Return Integer division and modulo of series and other, element-wise (binary operator divmod).
dot(other)
Compute the dot product between the Series and the columns of other.
drop([labels, axis, index, columns, level, ...])
Return Series with specified index labels removed.
drop_duplicates([keep, inplace])
Return Series with duplicate values removed.
droplevel(level[, axis])
Return Series/DataFrame with requested index / column level(s) removed.
dropna([axis, inplace, how])
Return a new Series with missing values removed.
dt
alias of pandas.core.indexes.accessors.CombinedDatetimelikeProperties
duplicated([keep])
Indicate duplicate Series values.
eq(other[, level, fill_value, axis])
Return Equal to of series and other, element-wise (binary operator eq).
equals(other)
Test whether two objects contain the same elements.
ewm([com, span, halflife, alpha, ...])
Provide exponentially weighted (EW) calculations.
expanding([min_periods, center, axis, method])
Provide expanding window calculations.
explode([ignore_index])
Transform each element of a list-like to a row.
factorize([sort, na_sentinel])
Encode the object as an enumerated type or categorical variable.
ffill([axis, inplace, limit, downcast])
Synonym for DataFrame.fillna() with method='ffill'.
fillna([value, method, axis, inplace, ...])
Fill NA/NaN values using the specified method.
filter([items, like, regex, axis])
Subset the dataframe rows or columns according to the specified index labels.
first(offset)
Select initial periods of time series data based on a date offset.
first_valid_index()
Return index for first non-NA value or None, if no NA value is found.
floordiv(other[, level, fill_value, axis])
Return Integer division of series and other, element-wise (binary operator floordiv).
ge(other[, level, fill_value, axis])
Return Greater than or equal to of series and other, element-wise (binary operator ge).
get(key[, default])
Get item from object for given key (ex: DataFrame column).
groupby([by, axis, level, as_index, sort, ...])
Group Series using a mapper or by a Series of columns.
gt(other[, level, fill_value, axis])
Return Greater than of series and other, element-wise (binary operator gt).
head([n])
Return the first n rows.
hist([by, ax, grid, xlabelsize, xrot, ...])
Draw histogram of the input series using matplotlib.
idxmax([axis, skipna])
Return the row label of the maximum value.
idxmin([axis, skipna])
Return the row label of the minimum value.
infer_objects()
Attempt to infer better dtypes for object columns.
info([verbose, buf, max_cols, memory_usage, ...])
Print a concise summary of a Series.
interpolate([method, axis, limit, inplace, ...])
Fill NaN values using an interpolation method.
isin(values)
Whether elements in Series are contained in values.
isna()
Detect missing values.
isnull()
Series.isnull is an alias for Series.isna.
item()
Return the first element of the underlying data as a Python scalar.
items()
Lazily iterate over (index, value) tuples.
iteritems()
Lazily iterate over (index, value) tuples.
keys()
Return alias for index.
kurt([axis, skipna, level, numeric_only])
Return unbiased kurtosis over requested axis.
kurtosis([axis, skipna, level, numeric_only])
Return unbiased kurtosis over requested axis.
last(offset)
Select final periods of time series data based on a date offset.
last_valid_index()
Return index for last non-NA value or None, if no NA value is found.
le(other[, level, fill_value, axis])
Return Less than or equal to of series and other, element-wise (binary operator le).
lt(other[, level, fill_value, axis])
Return Less than of series and other, element-wise (binary operator lt).
mad([axis, skipna, level])
Return the mean absolute deviation of the values over the requested axis.
map(arg[, na_action])
Map values of Series according to an input mapping or function.
mask(cond[, other, inplace, axis, level, ...])
Replace values where the condition is True.
max([axis, skipna, level, numeric_only])
Return the maximum of the values over the requested axis.
mean([axis, skipna, level, numeric_only])
Return the mean of the values over the requested axis.
median([axis, skipna, level, numeric_only])
Return the median of the values over the requested axis.
memory_usage([index, deep])
Return the memory usage of the Series.
min([axis, skipna, level, numeric_only])
Return the minimum of the values over the requested axis.
mod(other[, level, fill_value, axis])
Return Modulo of series and other, element-wise (binary operator mod).
mode([dropna])
Return the mode(s) of the Series.
mul(other[, level, fill_value, axis])
Return Multiplication of series and other, element-wise (binary operator mul).
multiply(other[, level, fill_value, axis])
Return Multiplication of series and other, element-wise (binary operator mul).
ne(other[, level, fill_value, axis])
Return Not equal to of series and other, element-wise (binary operator ne).
nlargest([n, keep])
Return the largest n elements.
notna()
Detect existing (non-missing) values.
notnull()
Series.notnull is an alias for Series.notna.
nsmallest([n, keep])
Return the smallest n elements.
nunique([dropna])
Return number of unique elements in the object.
pad([axis, inplace, limit, downcast])
Synonym for DataFrame.fillna() with method='ffill'.
pct_change([periods, fill_method, limit, freq])
Percentage change between the current and a prior element.
pipe(func, *args, **kwargs)
Apply chainable functions that expect Series or DataFrames.
plot
alias of pandas.plotting._core.PlotAccessor
pop(item)
Return item and drops from series.
pow(other[, level, fill_value, axis])
Return Exponential power of series and other, element-wise (binary operator pow).
prod([axis, skipna, level, numeric_only, ...])
Return the product of the values over the requested axis.
product([axis, skipna, level, numeric_only, ...])
Return the product of the values over the requested axis.
quantile([q, interpolation])
Return value at the given quantile.
radd(other[, level, fill_value, axis])
Return Addition of series and other, element-wise (binary operator radd).
rank([axis, method, numeric_only, ...])
Compute numerical data ranks (1 through n) along axis.
ravel([order])
Return the flattened underlying data as an ndarray.
rdiv(other[, level, fill_value, axis])
Return Floating division of series and other, element-wise (binary operator rtruediv).
rdivmod(other[, level, fill_value, axis])
Return Integer division and modulo of series and other, element-wise (binary operator rdivmod).
reindex(*args, **kwargs)
Conform Series to new index with optional filling logic.
reindex_like(other[, method, copy, limit, ...])
Return an object with matching indices as other object.
rename([index, axis, copy, inplace, level, ...])
Alter Series index labels or name.
rename_axis([mapper, index, columns, axis, ...])
Set the name of the axis for the index or columns.
reorder_levels(order)
Rearrange index levels using input order.
repeat(repeats[, axis])
Repeat elements of a Series.
replace([to_replace, value, inplace, limit, ...])
Replace values given in to_replace with value.
resample(rule[, axis, closed, label, ...])
Resample time-series data.
reset_index([level, drop, name, inplace])
Generate a new DataFrame or Series with the index reset.
rfloordiv(other[, level, fill_value, axis])
Return Integer division of series and other, element-wise (binary operator rfloordiv).
rmod(other[, level, fill_value, axis])
Return Modulo of series and other, element-wise (binary operator rmod).
rmul(other[, level, fill_value, axis])
Return Multiplication of series and other, element-wise (binary operator rmul).
rolling(window[, min_periods, center, ...])
Provide rolling window calculations.
round([decimals])
Round each value in a Series to the given number of decimals.
rpow(other[, level, fill_value, axis])
Return Exponential power of series and other, element-wise (binary operator rpow).
rsub(other[, level, fill_value, axis])
Return Subtraction of series and other, element-wise (binary operator rsub).
rtruediv(other[, level, fill_value, axis])
Return Floating division of series and other, element-wise (binary operator rtruediv).
sample([n, frac, replace, weights, ...])
Return a random sample of items from an axis of object.
searchsorted(value[, side, sorter])
Find indices where elements should be inserted to maintain order.
sem([axis, skipna, level, ddof, numeric_only])
Return unbiased standard error of the mean over requested axis.
set_axis(labels[, axis, inplace])
Assign desired index to given axis.
set_flags(*[, copy, allows_duplicate_labels])
Return a new object with updated flags.
shift([periods, freq, axis, fill_value])
Shift index by desired number of periods with an optional time freq.
skew([axis, skipna, level, numeric_only])
Return unbiased skew over requested axis.
slice_shift([periods, axis])
(DEPRECATED) Equivalent to shift without copying data.
sort_index([axis, level, ascending, ...])
Sort Series by index labels.
sort_values([axis, ascending, inplace, ...])
Sort by the values.
sparse
alias of pandas.core.arrays.sparse.accessor.SparseAccessor
squeeze([axis])
Squeeze 1 dimensional axis objects into scalars.
std([axis, skipna, level, ddof, numeric_only])
Return sample standard deviation over requested axis.
str
alias of pandas.core.strings.accessor.StringMethods
sub(other[, level, fill_value, axis])
Return Subtraction of series and other, element-wise (binary operator sub).
subtract(other[, level, fill_value, axis])
Return Subtraction of series and other, element-wise (binary operator sub).
sum([axis, skipna, level, numeric_only, ...])
Return the sum of the values over the requested axis.
swapaxes(axis1, axis2[, copy])
Interchange axes and swap values axes appropriately.
swaplevel([i, j, copy])
Swap levels i and j in a MultiIndex.
tail([n])
Return the last n rows.
take(indices[, axis, is_copy])
Return the elements in the given positional indices along an axis.
to_clipboard([excel, sep])
Copy object to the system clipboard.
to_csv([path_or_buf, sep, na_rep, ...])
Write object to a comma-separated values (csv) file.
to_dict([into])
Convert Series to {label -> value} dict or dict-like object.
to_excel(excel_writer[, sheet_name, na_rep, ...])
Write object to an Excel sheet.
to_frame([name])
Convert Series to DataFrame.
to_hdf(path_or_buf, key[, mode, complevel, ...])
Write the contained data to an HDF5 file using HDFStore.
to_json([path_or_buf, orient, date_format, ...])
Convert the object to a JSON string.
to_latex([buf, columns, col_space, header, ...])
Render object to a LaTeX tabular, longtable, or nested table.
to_list()
Return a list of the values.
to_markdown([buf, mode, index, storage_options])
Print Series in Markdown-friendly format.
to_numpy([dtype, copy, na_value])
A NumPy ndarray representing the values in this Series or Index.
to_period([freq, copy])
Convert Series from DatetimeIndex to PeriodIndex.
to_pickle(path[, compression, protocol, ...])
Pickle (serialize) object to file.
to_sql(name, con[, schema, if_exists, ...])
Write records stored in a DataFrame to a SQL database.
to_string([buf, na_rep, float_format, ...])
Render a string representation of the Series.
to_timestamp([freq, how, copy])
Cast to DatetimeIndex of Timestamps, at beginning of period.
to_xarray()
Return an xarray object from the pandas object.
tolist()
Return a list of the values.
transform(func[, axis])
Call func on self producing a Series with the same axis shape as self.
transpose(*args, **kwargs)
Return the transpose, which is by definition self.
truediv(other[, level, fill_value, axis])
Return Floating division of series and other, element-wise (binary operator truediv).
truncate([before, after, axis, copy])
Truncate a Series or DataFrame before and after some index value.
tshift([periods, freq, axis])
(DEPRECATED) Shift the time index, using the index's frequency if available.
tz_convert(tz[, axis, level, copy])
Convert tz-aware axis to target time zone.
tz_localize(tz[, axis, level, copy, ...])
Localize tz-naive index of a Series or DataFrame to target time zone.
unique()
Return unique values of Series object.
unstack([level, fill_value])
Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.
update(other)
Modify Series in place using values from passed Series.
value_counts([normalize, sort, ascending, ...])
Return a Series containing counts of unique values.
var([axis, skipna, level, ddof, numeric_only])
Return unbiased variance over requested axis.
view([dtype])
Create a new view of the Series.
where(cond[, other, inplace, axis, level, ...])
Replace values where the condition is False.
xs(key[, axis, level, drop_level])
Return cross-section from the Series/DataFrame.


Return the values as a NumPy array.
Users should not call this directly. Rather, it is invoked by numpy.array() and numpy.asarray().
The dtype to use for the resulting NumPy array. By default, the dtype is inferred from the data.
The values in the series converted to a numpy.ndarray with the specified dtype.
See also
Create a new array from data.
Zero-copy view to the array backing the Series.
Series method for similar behavior.
Examples
For timezone-aware data, the timezones may be retained with dtype='object'
Or the values may be localized to UTC and the tzinfo discarded with dtype='datetime64[ns]'


Return an iterator of the values.
These are each a scalar type, which is a Python scalar (for str, int, float) or a pandas scalar (for Timestamp/Timedelta/Interval/Period)


Return a Series/DataFrame with absolute numeric value of each element.
This function only applies to elements that are all numeric.
Series/DataFrame containing the absolute value of each element.
See also
Calculate the absolute value element-wise.
Notes
For complex inputs, 1.2 + 1j, the absolute value is \(\sqrt{ a^2 + b^2 }\).
Examples
Absolute numeric values in a Series.
Absolute numeric values in a Series with complex numbers.
Absolute numeric values in a Series with a Timedelta element.
Select rows with data closest to certain value using argsort (from StackOverflow).


Return Addition of series and other, element-wise (binary operator add).
Equivalent to series + other, but with support to substitute a fill_value for missing data in either one of the inputs.
Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing.
Broadcast across a level, matching Index values on the passed MultiIndex level.
The result of the operation.
See also
Reverse of the Addition operator, see Python documentation for more details.
Examples


Prefix labels with string prefix.
For Series, the row labels are prefixed. For DataFrame, the column labels are prefixed.
The string to add before each label.
New Series or DataFrame with updated labels.
See also
Suffix row labels with string suffix.
Suffix column labels with string suffix.
Examples


Suffix labels with string suffix.
For Series, the row labels are suffixed. For DataFrame, the column labels are suffixed.
The string to add after each label.
New Series or DataFrame with updated labels.
See also
Prefix row labels with string prefix.
Prefix column labels with string prefix.
Examples


Aggregate using one or more operations over the specified axis.
Function to use for aggregating the data. If a function, must either work when passed a Series or when passed to Series.apply.
Accepted combinations are:
function
string function name
list of functions and/or function names, e.g. [np.sum, 'mean']
dict of axis labels -> functions, function names or list of such.
Parameter needed for compatibility with DataFrame.
Positional arguments to pass to func.
Keyword arguments to pass to func.
The return can be:
scalar : when Series.agg is called with single function
Series : when DataFrame.agg is called with a single function
DataFrame : when DataFrame.agg is called with several functions
Return scalar, Series or DataFrame.
See also
Invoke function on a Series.
Transform function producing a Series with like indexes.
Notes
agg is an alias for aggregate. Use the alias.
Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See Mutating with User Defined Function (UDF) methods for more details.
A passed user-defined-function will be passed a Series for evaluation.
Examples


Align two objects on their axes with the specified join method.
Join method is specified for each axis Index.
Align on index (0), columns (1), or both (None).
Broadcast across a level, matching Index values on the passed MultiIndex level.
Always returns new objects. If copy=False and no reindexing is required then original objects are returned.
Value to use for missing values. Defaults to NaN, but can be any “compatible” value.
Method to use for filling holes in reindexed Series:
pad / ffill: propagate last valid observation forward to next valid.
backfill / bfill: use NEXT valid observation to fill gap.
If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled. Must be greater than 0 if not None.
Filling axis, method and limit.
Broadcast values along this axis, if aligning two objects of different dimensions.
Aligned objects.
Examples
Align on columns:
We can also align on the index:
Finally, the default axis=None will align on both index and columns:


Return whether all elements are True, potentially over an axis.
Returns True unless there at least one element within a series or along a Dataframe axis that is False or equivalent (e.g. zero or empty).
Indicate which axis or axes should be reduced.
0 / ‘index’ : reduce the index, return a Series whose index is the original column labels.
1 / ‘columns’ : reduce the columns, return a Series whose index is the original index.
None : reduce all axes, return a scalar.
Include only boolean columns. If None, will attempt to use everything, then use only boolean data. Not implemented for Series.
Exclude NA/null values. If the entire row/column is NA and skipna is True, then the result will be True, as for an empty row/column. If skipna is False, then NA are treated as True, because these are not equal to zero.
If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a scalar.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
If level is specified, then, Series is returned; otherwise, scalar is returned.
See also
Return True if all elements are True.
Return True if one (or more) elements are True.
Examples
Series
DataFrames
Create a dataframe from a dictionary.
Default behaviour checks if column-wise values all return True.
Specify axis='columns' to check if row-wise values all return True.
Or axis=None for whether every value is True.


Return whether any element is True, potentially over an axis.
Returns False unless there is at least one element within a series or along a Dataframe axis that is True or equivalent (e.g. non-zero or non-empty).
Indicate which axis or axes should be reduced.
0 / ‘index’ : reduce the index, return a Series whose index is the original column labels.
1 / ‘columns’ : reduce the columns, return a Series whose index is the original index.
None : reduce all axes, return a scalar.
Include only boolean columns. If None, will attempt to use everything, then use only boolean data. Not implemented for Series.
Exclude NA/null values. If the entire row/column is NA and skipna is True, then the result will be False, as for an empty row/column. If skipna is False, then NA are treated as True, because these are not equal to zero.
If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a scalar.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
If level is specified, then, Series is returned; otherwise, scalar is returned.
See also
Numpy version of this method.
Return whether any element is True.
Return whether all elements are True.
Return whether any element is True over requested axis.
Return whether all elements are True over requested axis.
Examples
Series
For Series input, the output is a scalar indicating whether any element is True.
DataFrame
Whether each column contains at least one True element (the default).
Aggregating over the columns.
Aggregating over the entire DataFrame with axis=None.
any for an empty DataFrame is an empty Series.


Concatenate two or more Series.
Series to append with self.
If True, the resulting axis will be labeled 0, 1, …, n - 1.
If True, raise Exception on creating index with duplicates.
Concatenated Series.
See also
General function to concatenate DataFrame or Series objects.
Notes
Iteratively appending to a Series can be more computationally intensive than a single concatenate. A better solution is to append values to a list and then concatenate the list with the original Series all at once.
Examples
With ignore_index set to True:
With verify_integrity set to True:


Invoke function on values of Series.
Can be ufunc (a NumPy function that applies to the entire Series) or a Python function that only works on single values.
Python function or NumPy ufunc to apply.
Try to find better dtype for elementwise function results. If False, leave as dtype=object. Note that the dtype is always preserved for some extension array dtypes, such as Categorical.
Positional arguments passed to func after the series value.
Additional keyword arguments passed to func.
If func returns a Series object the result will be a DataFrame.
See also
For element-wise operations.
Only perform aggregating type operations.
Only perform transforming type operations.
Notes
Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See Mutating with User Defined Function (UDF) methods for more details.
Examples
Create a series with typical summer temperatures for each city.
Square the values by defining a function and passing it as an argument to apply().
Square the values by passing an anonymous function as an argument to apply().
Define a custom function that needs additional positional arguments and pass these additional arguments using the args keyword.
Define a custom function that takes keyword arguments and pass these arguments to apply.
Use a function from the Numpy library.


Return int position of the largest value in the Series.
If the maximum is achieved in multiple locations, the first row position is returned.
Dummy argument for consistency with Series.
Exclude NA/null values when showing the result.
Additional arguments and keywords for compatibility with NumPy.
Row position of the maximum value.
See also
Return position of the maximum value.
Return position of the minimum value.
Equivalent method for numpy arrays.
Return index label of the maximum values.
Return index label of the minimum values.
Examples
Consider dataset containing cereal calories
The maximum cereal calories is the third element and the minimum cereal calories is the first element, since series is zero-indexed.


Return int position of the smallest value in the Series.
If the minimum is achieved in multiple locations, the first row position is returned.
Dummy argument for consistency with Series.
Exclude NA/null values when showing the result.
Additional arguments and keywords for compatibility with NumPy.
Row position of the minimum value.
See also
Return position of the minimum value.
Return position of the maximum value.
Equivalent method for numpy arrays.
Return index label of the maximum values.
Return index label of the minimum values.
Examples
Consider dataset containing cereal calories
The maximum cereal calories is the third element and the minimum cereal calories is the first element, since series is zero-indexed.


Return the integer indices that would sort the Series values.
Override ndarray.argsort. Argsorts the value, omitting NA/null values, and places the result in the same locations as the non-NA values.
Has no effect but is accepted for compatibility with numpy.
Choice of sorting algorithm. See numpy.sort() for more information. ‘mergesort’ and ‘stable’ are the only stable algorithms.
Has no effect but is accepted for compatibility with numpy.
Positions of values within the sort order with -1 indicating nan values.
See also
Returns the indices that would sort this array.


The ExtensionArray of the data backing this Series or Index.
An ExtensionArray of the values stored within. For extension types, this is the actual array. For NumPy native types, this is a thin (no copy) wrapper around numpy.ndarray.
.array differs .values which may require converting the data to a different form.
See also
Similar method that always returns a NumPy array.
Similar method that always returns a NumPy array.
Notes
This table lays out the different array types for each extension dtype within pandas.
dtype
array type
category
Categorical
period
PeriodArray
interval
IntervalArray
IntegerNA
IntegerArray
string
StringArray
boolean
BooleanArray
datetime64[ns, tz]
DatetimeArray
For any 3rd-party extension types, the array type will be an ExtensionArray.
For all remaining dtypes .array will be a arrays.NumpyExtensionArray wrapping the actual ndarray stored within. If you absolutely need a NumPy array (possibly with copying / coercing data), then use Series.to_numpy() instead.
Examples
For regular NumPy types like int, and float, a PandasArray is returned.
For extension types, like Categorical, the actual ExtensionArray is returned


Convert time series to specified frequency.
Returns the original data conformed to a new index with the specified frequency.
If the index of this Series is a PeriodIndex, the new index is the result of transforming the original index with PeriodIndex.asfreq (so the original index will map one-to-one to the new index).
Otherwise, the new index will be equivalent to pd.date_range(start, end,
freq=freq) where start and end are, respectively, the first and last entries in the original index (see pandas.date_range()). The values corresponding to any timesteps in the new index which were not present in the original index will be null (NaN), unless a method for filling such unknowns is provided (see the method parameter below).
The resample() method is more appropriate if an operation on each group of timesteps (such as an aggregate) is necessary to represent the data at the new frequency.
Frequency DateOffset or string.
Method to use for filling holes in reindexed Series (note this does not fill NaNs that already were present):
‘pad’ / ‘ffill’: propagate last valid observation forward to next valid
‘backfill’ / ‘bfill’: use NEXT valid observation to fill.
For PeriodIndex only (see PeriodIndex.asfreq).
Whether to reset output index to midnight.
Value to use for missing values, applied during upsampling (note this does not fill NaNs that already were present).
Series object reindexed to the specified frequency.
See also
Conform DataFrame to new index with optional filling logic.
Notes
To learn more about the frequency strings, please see this link.
Examples
Start by creating a series with 4 one minute timestamps.
Upsample the series into 30 second bins.
Upsample again, providing a fill value.
Upsample again, providing a method.


Return the last row(s) without any NaNs before where.
The last row (for each element in where, if list) without any NaN is taken. In case of a DataFrame, the last row without NaN considering only the subset of columns (if not None)
If there is no good value, NaN is returned for a Series or a Series of NaN values for a DataFrame
Date(s) before which the last row(s) are returned.
For DataFrame, if not None, only use these columns to check for NaNs.
The return can be:
scalar : when self is a Series and where is a scalar
Series: when self is a Series and where is an array-like, or when self is a DataFrame and where is a scalar
DataFrame : when self is a DataFrame and where is an array-like
Return scalar, Series, or DataFrame.
See also
Perform an asof merge. Similar to left join.
Notes
Dates are assumed to be sorted. Raises if this is not the case.
Examples
A Series and a scalar where.
For a sequence where, a Series is returned. The first value is NaN, because the first element of where is before the first index value.
Missing values are not considered. The following is 2.0, not NaN, even though NaN is at the index location for 30.
Take all columns into consideration
Take a single column into consideration


Cast a pandas object to a specified dtype dtype.
Use a numpy.dtype or Python type to cast entire pandas object to the same type. Alternatively, use {col: dtype, …}, where col is a column label and dtype is a numpy.dtype or Python type to cast one or more of the DataFrame’s columns to column-specific types.
Return a copy when copy=True (be very careful setting copy=False as changes to values then may propagate to other pandas objects).
Control raising of exceptions on invalid data for provided dtype.
raise : allow exceptions to be raised
ignore : suppress exceptions. On error return original object.
See also
Convert argument to datetime.
Convert argument to timedelta.
Convert argument to a numeric type.
Cast a numpy array to a specified type.
Notes
Deprecated since version 1.3.0: Using astype to convert from timezone-naive dtype to timezone-aware dtype is deprecated and will raise in a future version. Use Series.dt.tz_localize() instead.
Examples
Create a DataFrame:
Cast all columns to int32:
Cast col1 to int32 using a dictionary:
Create a series:
Convert to categorical type:
Convert to ordered categorical type with custom ordering:
Note that using copy=False and changing data on a new pandas object may propagate changes:
Create a series of dates:


Access a single value for a row/column label pair.
Similar to loc, in that both provide label-based lookups. Use at if you only need to get or set a single value in a DataFrame or Series.
If ‘label’ does not exist in DataFrame.
See also
Access a single value for a row/column pair by integer position.
Access a group of rows and columns by label(s).
Access a single value using a label.
Examples
Get value at specified row/column pair
Set value at specified row/column pair
Get value within a Series


Select values at particular time of day (e.g., 9:30AM).
If the index is not a DatetimeIndex
See also
Select values between particular times of the day.
Select initial periods of time series based on a date offset.
Select final periods of time series based on a date offset.
Get just the index locations for values at particular time of the day.
Examples


Dictionary of global attributes of this dataset.
Warning
attrs is experimental and may change without warning.
See also
Global flags applying to this object.


Compute the lag-N autocorrelation.
This method computes the Pearson correlation between the Series and its shifted self.
Number of lags to apply before performing autocorrelation.
The Pearson correlation between self and self.shift(lag).
See also
Compute the correlation between two Series.
Shift index by desired number of periods.
Compute pairwise correlation of columns.
Compute pairwise correlation between rows or columns of two DataFrame objects.
Notes
If the Pearson correlation is not well defined return ‘NaN’.
Examples
If the Pearson correlation is not well defined, then ‘NaN’ is returned.


Synonym for DataFrame.fillna() with method='bfill'.
Object with missing values filled or None if inplace=True.


Return boolean Series equivalent to left <= series <= right.
This function returns a boolean vector containing True wherever the corresponding Series element is between the boundary values left and right. NA values are treated as False.
Left boundary.
Right boundary.
Include boundaries. Whether to set each bound as closed or open.
Changed in version 1.3.0.
Series representing whether each element is between left and right (inclusive).
See also
Greater than of series and other.
Less than of series and other.
Notes
This function is equivalent to (left <= ser) & (ser <= right)
Examples
Boundary values are included by default:
With inclusive set to "neither" boundary values are excluded:
left and right can be any scalar value:


Select values between particular times of the day (e.g., 9:00-9:30 AM).
By setting start_time to be later than end_time, you can get the times that are not between the two times.
Initial time as a time filter limit.
End time as a time filter limit.
Whether the start time needs to be included in the result.
Deprecated since version 1.4.0: Arguments include_start and include_end have been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.
Whether the end time needs to be included in the result.
Deprecated since version 1.4.0: Arguments include_start and include_end have been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.
Include boundaries; whether to set each bound as closed or open.
Determine range time on index or columns value.
Data from the original object filtered to the specified dates range.
If the index is not a DatetimeIndex
See also
Select values at a particular time of the day.
Select initial periods of time series based on a date offset.
Select final periods of time series based on a date offset.
Get just the index locations for values between particular times of the day.
Examples
You get the times that are not between two times by setting start_time later than end_time:


Return the bool of a single element Series or DataFrame.
This must be a boolean scalar value, either True or False. It will raise a ValueError if the Series or DataFrame does not have exactly 1 element, or that element is not boolean (integer values 0 and 1 will also raise an exception).
The value in the Series or DataFrame.
See also
Change the data type of a Series, including to boolean.
Change the data type of a DataFrame, including to boolean.
NumPy boolean data type, used by pandas for boolean values.
Examples
The method will only work for single element objects with a boolean value:


Accessor object for categorical properties of the Series values.
Be aware that assigning to categories is a inplace operation, while all methods return new categorical data per default (but can be called with inplace=True).
Examples


Add new categories.
new_categories will be included at the last/highest place in the categories and will be unused directly after this call.
The new categories to be included.
Whether or not to add the categories inplace or return a copy of this categorical with added categories.
Deprecated since version 1.3.0.
Categorical with new categories added or None if inplace=True.
If the new categories include old categories or do not validate as categories
See also
Rename categories.
Reorder categories.
Remove the specified categories.
Remove categories which are not used.
Set the categories to the specified ones.
Examples


Set the Categorical to be ordered.
Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True.
Ordered Categorical or None if inplace=True.


Set the Categorical to be unordered.
Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to False.
Unordered Categorical or None if inplace=True.


The categories of this categorical.
Setting assigns new values to each category (effectively a rename of each individual category).
The assigned value has to be a list-like object. All items must be unique and the number of items in the new categories must be the same as the number of items in the old categories.
Assigning to categories is a inplace operation!
If the new categories do not validate as categories or if the number of new categories is unequal the number of old categories
See also
Rename categories.
Reorder categories.
Add new categories.
Remove the specified categories.
Remove categories which are not used.
Set the categories to the specified ones.


Return Series of codes as well as the index.


Whether the categories have an ordered relationship.


Remove the specified categories.
removals must be included in the old categories. Values which were in the removed categories will be set to NaN
The categories which should be removed.
Whether or not to remove the categories inplace or return a copy of this categorical with removed categories.
Deprecated since version 1.3.0.
Categorical with removed categories or None if inplace=True.
If the removals are not contained in the categories
See also
Rename categories.
Reorder categories.
Add new categories.
Remove categories which are not used.
Set the categories to the specified ones.
Examples


Remove categories which are not used.
Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped.
Deprecated since version 1.2.0.
Categorical with unused categories dropped or None if inplace=True.
See also
Rename categories.
Reorder categories.
Add new categories.
Remove the specified categories.
Set the categories to the specified ones.
Examples


Rename categories.
New categories which will replace old categories.
list-like: all items must be unique and the number of items in the new categories must match the existing number of categories.
dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored.
callable : a callable that is called on all items in the old categories and whose return values comprise the new categories.
Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories.
Deprecated since version 1.3.0.
Categorical with removed categories or None if inplace=True.
If new categories are list-like and do not have the same number of items than the current categories or do not validate as categories
See also
Reorder categories.
Add new categories.
Remove the specified categories.
Remove categories which are not used.
Set the categories to the specified ones.
Examples
For dict-like new_categories, extra keys are ignored and categories not in the dictionary are passed through
You may also provide a callable to create the new categories


Reorder categories as specified in new_categories.
new_categories need to include all old categories and no new category items.
The categories in new order.
Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information.
Whether or not to reorder the categories inplace or return a copy of this categorical with reordered categories.
Deprecated since version 1.3.0.
Categorical with removed categories or None if inplace=True.
If the new categories do not contain all old category items or any new ones
See also
Rename categories.
Add new categories.
Remove the specified categories.
Remove categories which are not used.
Set the categories to the specified ones.


Set the categories to the specified new_categories.
new_categories can include new categories (which will result in unused categories) or remove old categories (which results in values set to NaN). If rename==True, the categories will simple be renamed (less or more items than in old categories will result in values set to NaN or in unused categories respectively).
This method can be used to perform more than one action of adding, removing, and reordering simultaneously and is therefore faster than performing the individual steps via the more specialised methods.
On the other hand this methods does not do checks (e.g., whether the old categories are included in the new categories on a reorder), which can result in surprising changes, for example when using special string dtypes, which does not considers a S1 string equal to a single char python string.
The categories in new order.
Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information.
Whether or not the new_categories should be considered as a rename of the old categories or as reordered categories.
Whether or not to reorder the categories in-place or return a copy of this categorical with reordered categories.
Deprecated since version 1.3.0.
If new_categories does not validate as categories
See also
Rename categories.
Reorder categories.
Add new categories.
Remove the specified categories.
Remove categories which are not used.


Trim values at input threshold(s).
Assigns values outside boundary to boundary values. Thresholds can be singular values or array like, and in the latter case the clipping is performed element-wise in the specified axis.
Minimum threshold value. All values below this threshold will be set to it. A missing threshold (e.g NA) will not clip the value.
Maximum threshold value. All values above this threshold will be set to it. A missing threshold (e.g NA) will not clip the value.
Align object with lower and upper along the given axis.
Whether to perform the operation in place on the data.
Additional keywords have no effect but might be accepted for compatibility with numpy.
Same type as calling object with the values outside the clip boundaries replaced or None if inplace=True.
See also
Trim values at input threshold in series.
Trim values at input threshold in dataframe.
Clip (limit) the values in an array.
Examples
Clips per column using lower and upper thresholds:
Clips using specific lower and upper thresholds per column element:
Clips using specific lower threshold per column element, with missing values:


Combine the Series with a Series or scalar according to func.
Combine the Series and other using func to perform elementwise selection for combined Series. fill_value is assumed when value is missing at some index from one of the two objects being combined.
The value(s) to be combined with the Series.
Function that takes two scalars as inputs and returns an element.
The value to assume when an index is missing from one Series or the other. The default specifies to use the appropriate NaN value for the underlying dtype of the Series.
The result of combining the Series with the other object.
See also
Combine Series values, choosing the calling Series’ values first.
Examples
Consider 2 Datasets s1 and s2 containing highest clocked speeds of different birds.
Now, to combine the two datasets and view the highest speeds of the birds across the two datasets
In the previous example, the resulting value for duck is missing, because the maximum of a NaN and a float is a NaN. So, in the example, we set fill_value=0, so the maximum value returned will be the value from some dataset.


Update null elements with value in the same location in ‘other’.
Combine two Series objects by filling null values in one Series with non-null values from the other Series. Result index will be the union of the two indexes.
The value(s) to be used for filling null values.
The result of combining the provided Series with the other object.
See also
Perform element-wise operation on two Series using a given function.
Examples
Null values still persist if the location of that null value does not exist in other


Compare to another Series and show the differences.
New in version 1.1.0.
Object to compare with.
Determine which axis to align the comparison on.
with rows drawn alternately from self and other.
with columns drawn alternately from self and other.
If true, all rows and columns are kept. Otherwise, only the ones with different values are kept.
If true, the result keeps values that are equal. Otherwise, equal values are shown as NaNs.
If axis is 0 or ‘index’ the result will be a Series. The resulting index will be a MultiIndex with ‘self’ and ‘other’ stacked alternately at the inner level.
If axis is 1 or ‘columns’ the result will be a DataFrame. It will have two columns namely ‘self’ and ‘other’.
See also
Compare with another DataFrame and show differences.
Notes
Matching NaNs will not appear as a difference.
Examples
Align the differences on columns
Stack the differences on indices
Keep all original rows
Keep all original rows and also all original values


Convert columns to best possible dtypes using dtypes supporting pd.NA.
New in version 1.0.0.
Whether object dtypes should be converted to the best possible types.
Whether object dtypes should be converted to StringDtype().
Whether, if possible, conversion can be done to integer extension types.
Whether object dtypes should be converted to BooleanDtypes().
Whether, if possible, conversion can be done to floating extension types. If convert_integer is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers.
New in version 1.2.0.
Copy of input object with new dtype.
See also
Infer dtypes of objects.
Convert argument to datetime.
Convert argument to timedelta.
Convert argument to a numeric type.
Notes
By default, convert_dtypes will attempt to convert a Series (or each Series in a DataFrame) to dtypes that support pd.NA. By using the options convert_string, convert_integer, convert_boolean and convert_boolean, it is possible to turn off individual conversions to StringDtype, the integer extension types, BooleanDtype or floating extension types, respectively.
For object-dtyped columns, if infer_objects is True, use the inference rules as during normal Series/DataFrame construction. Then, if possible, convert to StringDtype, BooleanDtype or an appropriate integer or floating extension type, otherwise leave as object.
If the dtype is integer, convert to an appropriate integer extension type.
If the dtype is numeric, and consists of all integers, convert to an appropriate integer extension type. Otherwise, convert to an appropriate floating extension type.
Changed in version 1.2: Starting with pandas 1.2, this method also converts float columns to the nullable floating extension type.
In the future, as new dtypes are added that support pd.NA, the results of this method will change to support those new dtypes.
Examples
Start with a DataFrame with default dtypes.
Convert the DataFrame to use best possible dtypes.
Start with a Series of strings and missing data represented by np.nan.
Obtain a Series with dtype StringDtype.


Make a copy of this object’s indices and data.
When deep=True (default), a new object will be created with a copy of the calling object’s data and indices. Modifications to the data or indices of the copy will not be reflected in the original object (see notes below).
When deep=False, a new object will be created without copying the calling object’s data or index (only references to the data and index are copied). Any changes to the data of the original will be reflected in the shallow copy (and vice versa).
Make a deep copy, including a copy of the data and the indices. With deep=False neither the indices nor the data are copied.
Object type matches caller.
Notes
When deep=True, data is copied but actual Python objects will not be copied recursively, only the reference to the object. This is in contrast to copy.deepcopy in the Standard Library, which recursively copies object data (see examples below).
While Index objects are copied when deep=True, the underlying numpy array is not copied for performance reasons. Since Index is immutable, the underlying data can be safely shared and a copy is not needed.
Examples
Shallow copy versus default (deep) copy:
Shallow copy shares data and index with original.
Deep copy has own copy of data and index.
Updates to the data shared by shallow copy and original is reflected in both; deep copy remains unchanged.
Note that when copying an object containing Python objects, a deep copy will copy the data, but will not do so recursively. Updating a nested data object will be reflected in the deep copy.


Compute correlation with other Series, excluding missing values.
Series with which to compute the correlation.
Method used to compute correlation:
pearson : Standard correlation coefficient
kendall : Kendall Tau correlation coefficient
spearman : Spearman rank correlation
callable: Callable with input two 1d ndarrays and returning a float.
Warning
Note that the returned matrix from corr will have 1 along the diagonals and will be symmetric regardless of the callable’s behavior.
Minimum number of observations needed to have a valid result.
Correlation with other.
See also
Compute pairwise correlation between columns.
Compute pairwise correlation with another DataFrame or Series.
Examples


Return number of non-NA/null observations in the Series.
If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a smaller Series.
Number of non-null values in the Series.
See also
Count non-NA cells for each column or row.
Examples


Compute covariance with Series, excluding missing values.
Series with which to compute the covariance.
Minimum number of observations needed to have a valid result.
Delta degrees of freedom. The divisor used in calculations is N - ddof, where N represents the number of elements.
New in version 1.1.0.
Covariance between Series and other normalized by N-1 (unbiased estimator).
See also
Compute pairwise covariance of columns.
Examples


Return cumulative maximum over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative maximum.
The index or the name of the axis. 0 is equivalent to None or ‘index’.
Exclude NA/null values. If an entire row/column is NA, the result will be NA.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
Return cumulative maximum of scalar or Series.
See also
Similar functionality but ignores NaN values.
Return the maximum over Series axis.
Return cumulative maximum over Series axis.
Return cumulative minimum over Series axis.
Return cumulative sum over Series axis.
Return cumulative product over Series axis.
Examples
Series
By default, NA values are ignored.
To include NA values in the operation, use skipna=False
DataFrame
By default, iterates over rows and finds the maximum in each column. This is equivalent to axis=None or axis='index'.
To iterate over columns and find the maximum in each row, use axis=1


Return cumulative minimum over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative minimum.
The index or the name of the axis. 0 is equivalent to None or ‘index’.
Exclude NA/null values. If an entire row/column is NA, the result will be NA.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
Return cumulative minimum of scalar or Series.
See also
Similar functionality but ignores NaN values.
Return the minimum over Series axis.
Return cumulative maximum over Series axis.
Return cumulative minimum over Series axis.
Return cumulative sum over Series axis.
Return cumulative product over Series axis.
Examples
Series
By default, NA values are ignored.
To include NA values in the operation, use skipna=False
DataFrame
By default, iterates over rows and finds the minimum in each column. This is equivalent to axis=None or axis='index'.
To iterate over columns and find the minimum in each row, use axis=1


Return cumulative product over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative product.
The index or the name of the axis. 0 is equivalent to None or ‘index’.
Exclude NA/null values. If an entire row/column is NA, the result will be NA.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
Return cumulative product of scalar or Series.
See also
Similar functionality but ignores NaN values.
Return the product over Series axis.
Return cumulative maximum over Series axis.
Return cumulative minimum over Series axis.
Return cumulative sum over Series axis.
Return cumulative product over Series axis.
Examples
Series
By default, NA values are ignored.
To include NA values in the operation, use skipna=False
DataFrame
By default, iterates over rows and finds the product in each column. This is equivalent to axis=None or axis='index'.
To iterate over columns and find the product in each row, use axis=1


Return cumulative sum over a DataFrame or Series axis.
Returns a DataFrame or Series of the same size containing the cumulative sum.
The index or the name of the axis. 0 is equivalent to None or ‘index’.
Exclude NA/null values. If an entire row/column is NA, the result will be NA.
Additional keywords have no effect but might be accepted for compatibility with NumPy.
Return cumulative sum of scalar or Series.
See also
Similar functionality but ignores NaN values.
Return the sum over Series axis.
Return cumulative maximum over Series axis.
Return cumulative minimum over Series axis.
Return cumulative sum over Series axis.
Return cumulative product over Series axis.
Examples
Series
By default, NA values are ignored.
To include NA values in the operation, use skipna=False
DataFrame
By default, iterates over rows and finds the sum in each column. This is equivalent to axis=None or axis='index'.
To iterate over columns and find the sum in each row, use axis=1


Generate descriptive statistics.
Descriptive statistics include those that summarize the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.
Analyzes both numeric and object series, as well as DataFrame column sets of mixed data types. The output will vary depending on what is provided. Refer to the notes below for more detail.
The percentiles to include in the output. All should fall between 0 and 1. The default is [.25, .5, .75], which returns the 25th, 50th, and 75th percentiles.
A white list of data types to include in the result. Ignored for Series. Here are the options:
‘all’ : All columns of the input will be included in the output.
A list-like of dtypes : Limits the results to the provided data types. To limit the result to numeric types submit numpy.number. To limit it instead to object columns submit the numpy.object data type. Strings can also be used in the style of select_dtypes (e.g. df.describe(include=['O'])). To select pandas categorical columns, use 'category'
None (default) : The result will include all numeric columns.
A black list of data types to omit from the result. Ignored for Series. Here are the options:
A list-like of dtypes : Excludes the provided data types from the result. To exclude numeric types submit numpy.number. To exclude object columns submit the data type numpy.object. Strings can also be used in the style of select_dtypes (e.g. df.describe(exclude=['O'])). To exclude pandas categorical columns, use 'category'
None (default) : The result will exclude nothing.
Whether to treat datetime dtypes as numeric. This affects statistics calculated for the column. For DataFrame input, this also controls whether datetime columns are included by default.
New in version 1.1.0.
Summary statistics of the Series or Dataframe provided.
See also
Count number of non-NA/null observations.
Maximum of the values in the object.
Minimum of the values in the object.
Mean of the values.
Standard deviation of the observations.
Subset of a DataFrame including/excluding columns based on their dtype.
Notes
For numeric data, the result’s index will include count, mean, std, min, max as well as lower, 50 and upper percentiles. By default the lower percentile is 25 and the upper percentile is 75. The 50 percentile is the same as the median.
For object data (e.g. strings or timestamps), the result’s index will include count, unique, top, and freq. The top is the most common value. The freq is the most common value’s frequency. Timestamps also include the first and last items.
If multiple object values have the highest count, then the count and top results will be arbitrarily chosen from among those with the highest count.
For mixed data types provided via a DataFrame, the default is to return only an analysis of numeric columns. If the dataframe consists only of object and categorical data without any numeric columns, the default is to return an analysis of both the object and categorical columns. If include='all' is provided as an option, the result will include a union of attributes of each type.
The include and exclude parameters can be used to limit which columns in a DataFrame are analyzed for the output. The parameters are ignored when analyzing a Series.
Examples
Describing a numeric Series.
Describing a categorical Series.
Describing a timestamp Series.
Describing a DataFrame. By default only numeric fields are returned.
Describing all columns of a DataFrame regardless of data type.
Describing a column from a DataFrame by accessing it as an attribute.
Including only numeric columns in a DataFrame description.
Including only string columns in a DataFrame description.
Including only categorical columns from a DataFrame description.
Excluding numeric columns from a DataFrame description.
Excluding object columns from a DataFrame description.


First discrete difference of element.
Calculates the difference of a Series element compared with another element in the Series (default is element in previous row).
Periods to shift for calculating difference, accepts negative values.
First differences of the Series.
See also
Percent change over given number of periods.
Shift index by desired number of periods with an optional time freq.
First discrete difference of object.
Notes
For boolean dtypes, this uses operator.xor() rather than operator.sub(). The result is calculated according to current dtype in Series, however dtype of the result is always float64.
Examples
Difference with previous row
Difference with 3rd previous row
Difference with following row
Overflow in input dtype


Return Floating division of series and other, element-wise (binary operator truediv).
Equivalent to series / other, but with support to substitute a fill_value for missing data in either one of the inputs.
Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing.
Broadcast across a level, matching Index values on the passed MultiIndex level.
The result of the operation.
See also
Reverse of the Floating division operator, see Python documentation for more details.
Examples


Return Integer division and modulo of series and other, element-wise (binary operator divmod).
Equivalent to divmod(series, other), but with support to substitute a fill_value for missing data in either one of the inputs.
Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing.
Broadcast across a level, matching Index values on the passed MultiIndex level.
The result of the operation.
See also
Reverse of the Integer division and modulo operator, see Python documentation for more details.
Examples