pandas.eval   pandas.eval(expr, parser='pandas', engine=None, truediv=NoDefault.no_default, local_dict=None, global_dict=None, resolvers=(), level=0, target=None, inplace=False)[source]

Evaluate a Python expression as a string using various backends. The following arithmetic operations are supported: +, -, *, /, **, %, // (python engine only) along with the following boolean operations: | (or), & (and), and ~ (not). Additionally, the 'pandas' parser allows the use of and, or, and not with the same semantics as the corresponding bitwise operators. Series and DataFrame objects are supported and behave as they would with plain ol’ Python evaluation.  Parameters

expr:str

The expression to evaluate. This string cannot contain any Python statements, only Python expressions.
parser:{‘pandas’, ‘python’}, default ‘pandas’

The parser to use to construct the syntax tree from the expression. The default of 'pandas' parses code slightly different than standard Python. Alternatively, you can parse an expression using the 'python' parser to retain strict Python semantics. See the enhancing performance documentation for more details.
engine:{‘python’, ‘numexpr’}, default ‘numexpr’

The engine used to evaluate the expression. Supported engines are  None : tries to use numexpr, falls back to python

'numexpr': This default engine evaluates pandas objects using

numexpr for large speed ups in complex expressions with large frames.

'python': Performs operations as if you had eval’d in top

level python. This engine is generally not that useful.     More backends may be available in the future.
truediv:bool, optional

Whether to use true division, like in Python >= 3.  Deprecated since version 1.0.0.
local_dict:dict or None, optional

A dictionary of local variables, taken from locals() by default.
global_dict:dict or None, optional

A dictionary of global variables, taken from globals() by default.
resolvers:list of dict-like or None, optional

A list of objects implementing the __getitem__ special method that you can use to inject an additional collection of namespaces to use for variable lookup. For example, this is used in the query() method to inject the DataFrame.index and DataFrame.columns variables that refer to their respective DataFrame instance attributes.
level:int, optional

The number of prior stack frames to traverse and add to the current scope. Most users will not need to change this parameter.
target:object, optional, default None

This is the target object for assignment. It is used when there is variable assignment in the expression. If so, then target must support item assignment with string keys, and if a copy is being returned, it must also support .copy().
inplace:bool, default False

If target is provided, and the expression mutates target, whether to modify target inplace. Otherwise, return a copy of target with the mutation.    Returns
 ndarray, numeric scalar, DataFrame, Series, or None

The completion value of evaluating the given code or None if inplace=True.    Raises
 ValueError

There are many instances where such an error can be raised:  target=None, but the expression is multiline.
The expression is multiline, but not all them have item assignment. An example of such an arrangement is this: a = b + 1 a + 2 Here, there are expressions on different lines, making it multiline, but the last line has no variable assigned to the output of a + 2.  inplace=True, but the expression is missing item assignment. Item assignment is provided, but the target does not support string item assignment. Item assignment is provided and inplace=False, but the target does not support the .copy() method       See also  DataFrame.query

Evaluates a boolean expression to query the columns of a frame.  DataFrame.eval

Evaluate a string describing operations on DataFrame columns.    Notes The dtype of any objects involved in an arithmetic % operation are recursively cast to float64. See the enhancing performance documentation for more details. Examples
>>> df = pd.DataFrame({"animal": ["dog", "pig"], "age": [10, 20]})
>>> df
  animal  age
0    dog   10
1    pig   20
  We can add a new column using pd.eval:
>>> pd.eval("double_age = df.age * 2", target=df)
  animal  age  double_age
0    dog   10          20
1    pig   20          40


pandas.ExcelFile.parse   ExcelFile.parse(sheet_name=0, header=0, names=None, index_col=None, usecols=None, squeeze=None, converters=None, true_values=None, false_values=None, skiprows=None, nrows=None, na_values=None, parse_dates=False, date_parser=None, thousands=None, comment=None, skipfooter=0, convert_float=None, mangle_dupe_cols=True, **kwds)[source]

Parse specified sheet(s) into a DataFrame. Equivalent to read_excel(ExcelFile, …) See the read_excel docstring for more info on accepted parameters.  Returns
 DataFrame or dict of DataFrames

DataFrame from the passed in Excel file.


pandas.ExcelWriter   classpandas.ExcelWriter(path, engine=None, date_format=None, datetime_format=None, mode='w', storage_options=None, if_sheet_exists=None, engine_kwargs=None, **kwargs)[source]

Class for writing DataFrame objects into excel sheets. Default is to use : * xlwt for xls * xlsxwriter for xlsx if xlsxwriter is installed otherwise openpyxl * odf for ods. See DataFrame.to_excel for typical usage. The writer should be used as a context manager. Otherwise, call close() to save and close any opened file handles.  Parameters

path:str or typing.BinaryIO

Path to xls or xlsx or ods file.
engine:str (optional)

Engine to use for writing. If None, defaults to io.excel.<extension>.writer. NOTE: can only be passed as a keyword argument.  Deprecated since version 1.2.0: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas.
date_format:str, default None

Format string for dates written into Excel files (e.g. ‘YYYY-MM-DD’).
datetime_format:str, default None

Format string for datetime objects written into Excel files. (e.g. ‘YYYY-MM-DD HH:MM:SS’).
mode:{‘w’, ‘a’}, default ‘w’

File mode to use (write or append). Append does not work with fsspec URLs.
storage_options:dict, optional

Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc., if using a URL that will be parsed by fsspec, e.g., starting “s3://”, “gcs://”.  New in version 1.2.0.
if_sheet_exists:{‘error’, ‘new’, ‘replace’, ‘overlay’}, default ‘error’

How to behave when trying to write to a sheet that already exists (append mode only).  error: raise a ValueError. new: Create a new sheet, with a name determined by the engine. replace: Delete the contents of the sheet before writing to it. overlay: Write contents to the existing sheet without removing the old contents.   New in version 1.3.0.   Changed in version 1.4.0: Added overlay option
engine_kwargs:dict, optional

Keyword arguments to be passed into the engine. These will be passed to the following functions of the respective engines:  xlsxwriter: xlsxwriter.Workbook(file, **engine_kwargs) openpyxl (write mode): openpyxl.Workbook(**engine_kwargs) openpyxl (append mode): openpyxl.load_workbook(file, **engine_kwargs) odswriter: odf.opendocument.OpenDocumentSpreadsheet(**engine_kwargs)   New in version 1.3.0.
**kwargs:dict, optional

Keyword arguments to be passed into the engine.  Deprecated since version 1.3.0: Use engine_kwargs instead.      Notes None of the methods and properties are considered public. For compatibility with CSV writers, ExcelWriter serializes lists and dicts to strings before writing. Examples Default usage:
>>> df = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
>>> with pd.ExcelWriter("path_to_file.xlsx") as writer:
...     df.to_excel(writer)
  To write to separate sheets in a single file:
>>> df1 = pd.DataFrame([["AAA", "BBB"]], columns=["Spam", "Egg"])
>>> df2 = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
>>> with pd.ExcelWriter("path_to_file.xlsx") as writer:
...     df1.to_excel(writer, sheet_name="Sheet1")
...     df2.to_excel(writer, sheet_name="Sheet2")
  You can set the date format or datetime format:
>>> from datetime import date, datetime
>>> df = pd.DataFrame(
...     [
...         [date(2014, 1, 31), date(1999, 9, 24)],
...         [datetime(1998, 5, 26, 23, 33, 4), datetime(2014, 2, 28, 13, 5, 13)],
...     ],
...     index=["Date", "Datetime"],
...     columns=["X", "Y"],
... )
>>> with pd.ExcelWriter(
...     "path_to_file.xlsx",
...     date_format="YYYY-MM-DD",
...     datetime_format="YYYY-MM-DD HH:MM:SS"
... ) as writer:
...     df.to_excel(writer)
  You can also append to an existing Excel file:
>>> with pd.ExcelWriter("path_to_file.xlsx", mode="a", engine="openpyxl") as writer:
...     df.to_excel(writer, sheet_name="Sheet3")
  Here, the if_sheet_exists parameter can be set to replace a sheet if it already exists:
>>> with ExcelWriter(
...     "path_to_file.xlsx",
...     mode="a",
...     engine="openpyxl",
...     if_sheet_exists="replace",
... ) as writer:
...     df.to_excel(writer, sheet_name="Sheet1")
  You can also write multiple DataFrames to a single sheet. Note that the if_sheet_exists parameter needs to be set to overlay:
>>> with ExcelWriter("path_to_file.xlsx",
...     mode="a",
...     engine="openpyxl",
...     if_sheet_exists="overlay",
... ) as writer:
...     df1.to_excel(writer, sheet_name="Sheet1")
...     df2.to_excel(writer, sheet_name="Sheet1", startcol=3)
  You can store Excel file in RAM:
>>> import io
>>> df = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
>>> buffer = io.BytesIO()
>>> with pd.ExcelWriter(buffer) as writer:
...     df.to_excel(writer)
  You can pack Excel file into zip archive:
>>> import zipfile
>>> df = pd.DataFrame([["ABC", "XYZ"]], columns=["Foo", "Bar"])
>>> with zipfile.ZipFile("path_to_file.zip", "w") as zf:
...     with zf.open("filename.xlsx", "w") as buffer:
...         with pd.ExcelWriter(buffer) as writer:
...             df.to_excel(writer)
  You can specify additional arguments to the underlying engine:
>>> with pd.ExcelWriter(
...     "path_to_file.xlsx",
...     engine="xlsxwriter",
...     engine_kwargs={"options": {"nan_inf_to_errors": True}}
... ) as writer:
...     df.to_excel(writer)
  In append mode, engine_kwargs are passed through to openpyxl’s load_workbook:
>>> with pd.ExcelWriter(
...     "path_to_file.xlsx",
...     engine="openpyxl",
...     mode="a",
...     engine_kwargs={"keep_vba": True}
... ) as writer:
...     df.to_excel(writer, sheet_name="Sheet2")
  Attributes
None     Methods
None


pandas.factorize   pandas.factorize(values, sort=False, na_sentinel=- 1, size_hint=None)[source]

Encode the object as an enumerated type or categorical variable. This method is useful for obtaining a numeric representation of an array when all that matters is identifying distinct values. factorize is available as both a top-level function pandas.factorize(), and as a method Series.factorize() and Index.factorize().  Parameters

values:sequence

A 1-D sequence. Sequences that aren’t pandas objects are coerced to ndarrays before factorization.
sort:bool, default False

Sort uniques and shuffle codes to maintain the relationship.
na_sentinel:int or None, default -1

Value to mark “not found”. If None, will not drop the NaN from the uniques of the values.  Changed in version 1.1.2.
size_hint:int, optional

Hint to the hashtable sizer.    Returns

codes:ndarray

An integer ndarray that’s an indexer into uniques. uniques.take(codes) will have the same values as values.
uniques:ndarray, Index, or Categorical

The unique valid values. When values is Categorical, uniques is a Categorical. When values is some other pandas object, an Index is returned. Otherwise, a 1-D ndarray is returned.  Note Even if there’s a missing value in values, uniques will not contain an entry for it.       See also  cut

Discretize continuous-valued array.  unique

Find the unique value in an array.    Examples These examples all show factorize as a top-level method like pd.factorize(values). The results are identical for methods like Series.factorize().
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'])
>>> codes
array([0, 0, 1, 2, 0]...)
>>> uniques
array(['b', 'a', 'c'], dtype=object)
  With sort=True, the uniques will be sorted, and codes will be shuffled so that the relationship is the maintained.
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'], sort=True)
>>> codes
array([1, 1, 0, 2, 1]...)
>>> uniques
array(['a', 'b', 'c'], dtype=object)
  Missing values are indicated in codes with na_sentinel (-1 by default). Note that missing values are never included in uniques.
>>> codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b'])
>>> codes
array([ 0, -1,  1,  2,  0]...)
>>> uniques
array(['b', 'a', 'c'], dtype=object)
  Thus far, we’ve only factorized lists (which are internally coerced to NumPy arrays). When factorizing pandas objects, the type of uniques will differ. For Categoricals, a Categorical is returned.
>>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c'])
>>> codes, uniques = pd.factorize(cat)
>>> codes
array([0, 0, 1]...)
>>> uniques
['a', 'c']
Categories (3, object): ['a', 'b', 'c']
  Notice that 'b' is in uniques.categories, despite not being present in cat.values. For all other pandas objects, an Index of the appropriate type is returned.
>>> cat = pd.Series(['a', 'a', 'c'])
>>> codes, uniques = pd.factorize(cat)
>>> codes
array([0, 0, 1]...)
>>> uniques
Index(['a', 'c'], dtype='object')
  If NaN is in the values, and we want to include NaN in the uniques of the values, it can be achieved by setting na_sentinel=None.
>>> values = np.array([1, 2, 1, np.nan])
>>> codes, uniques = pd.factorize(values)  # default: na_sentinel=-1
>>> codes
array([ 0,  1,  0, -1])
>>> uniques
array([1., 2.])

>>> codes, uniques = pd.factorize(values, na_sentinel=None)
>>> codes
array([0, 1, 0, 2])
>>> uniques
array([ 1.,  2., nan])


pandas.Flags   classpandas.Flags(obj, *, allows_duplicate_labels)[source]

Flags that apply to pandas objects.  New in version 1.2.0.   Parameters

obj:Series or DataFrame

The object these flags are associated with.
allows_duplicate_labels:bool, default True

Whether to allow duplicate labels in this object. By default, duplicate labels are permitted. Setting this to False will cause an errors.DuplicateLabelError to be raised when index (or columns for DataFrame) is not unique, or any subsequent operation on introduces duplicates. See Disallowing Duplicate Labels for more.  Warning This is an experimental feature. Currently, many methods fail to propagate the allows_duplicate_labels value. In future versions it is expected that every method taking or returning one or more DataFrame or Series objects will propagate allows_duplicate_labels.      Notes Attributes can be set in two ways
>>> df = pd.DataFrame()
>>> df.flags
<Flags(allows_duplicate_labels=True)>
>>> df.flags.allows_duplicate_labels = False
>>> df.flags
<Flags(allows_duplicate_labels=False)>

>>> df.flags['allows_duplicate_labels'] = True
>>> df.flags
<Flags(allows_duplicate_labels=True)>
  Attributes
allows_duplicate_labels Whether this object allows duplicate labels.


pandas.Flags.allows_duplicate_labels   propertyFlags.allows_duplicate_labels

Whether this object allows duplicate labels. Setting allows_duplicate_labels=False ensures that the index (and columns of a DataFrame) are unique. Most methods that accept and return a Series or DataFrame will propagate the value of allows_duplicate_labels. See Duplicate Labels for more.  See also  DataFrame.attrs

Set global metadata on this object.  DataFrame.set_flags

Set global flags on this object.    Examples
>>> df = pd.DataFrame({"A": [1, 2]}, index=['a', 'a'])
>>> df.flags.allows_duplicate_labels
True
>>> df.flags.allows_duplicate_labels = False
Traceback (most recent call last):
    ...
pandas.errors.DuplicateLabelError: Index has duplicates.
      positions
label
a        [0, 1]


pandas.Float64Index   classpandas.Float64Index(data=None, dtype=None, copy=False, name=None)[source]

Immutable sequence used for indexing and alignment. The basic object storing axis labels for all pandas objects. Float64Index is a special case of Index with purely float labels. .  Deprecated since version 1.4.0: In pandas v2.0 Float64Index will be removed and NumericIndex used instead. Float64Index will remain fully functional for the duration of pandas 1.x.   Parameters

data:array-like (1-dimensional)

dtype:NumPy dtype (default: float64)

copy:bool

Make a copy of input ndarray.
name:object

Name to be stored in the index.      See also  Index

The base pandas Index type.  NumericIndex

Index of numpy int/uint/float data.    Notes An Index instance can only contain hashable objects. Attributes
None     Methods
None


pandas.get_dummies   pandas.get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=None)[source]

Convert categorical variable into dummy/indicator variables.  Parameters

data:array-like, Series, or DataFrame

Data of which to get dummy indicators.
prefix:str, list of str, or dict of str, default None

String to append DataFrame column names. Pass a list with length equal to the number of columns when calling get_dummies on a DataFrame. Alternatively, prefix can be a dictionary mapping column names to prefixes.
prefix_sep:str, default ‘_’

If appending prefix, separator/delimiter to use. Or pass a list or dictionary as with prefix.
dummy_na:bool, default False

Add a column to indicate NaNs, if False NaNs are ignored.
columns:list-like, default None

Column names in the DataFrame to be encoded. If columns is None then all the columns with object or category dtype will be converted.
sparse:bool, default False

Whether the dummy-encoded columns should be backed by a SparseArray (True) or a regular NumPy array (False).
drop_first:bool, default False

Whether to get k-1 dummies out of k categorical levels by removing the first level.
dtype:dtype, default np.uint8

Data type for new columns. Only a single dtype is allowed.    Returns
 DataFrame

Dummy-coded data.      See also  Series.str.get_dummies

Convert Series to dummy codes.    Examples
>>> s = pd.Series(list('abca'))

>>> pd.get_dummies(s)
   a  b  c
0  1  0  0
1  0  1  0
2  0  0  1
3  1  0  0

>>> s1 = ['a', 'b', np.nan]

>>> pd.get_dummies(s1)
   a  b
0  1  0
1  0  1
2  0  0

>>> pd.get_dummies(s1, dummy_na=True)
   a  b  NaN
0  1  0    0
1  0  1    0
2  0  0    1

>>> df = pd.DataFrame({'A': ['a', 'b', 'a'], 'B': ['b', 'a', 'c'],
...                    'C': [1, 2, 3]})

>>> pd.get_dummies(df, prefix=['col1', 'col2'])
   C  col1_a  col1_b  col2_a  col2_b  col2_c
0  1       1       0       0       1       0
1  2       0       1       1       0       0
2  3       1       0       0       0       1

>>> pd.get_dummies(pd.Series(list('abcaa')))
   a  b  c
0  1  0  0
1  0  1  0
2  0  0  1
3  1  0  0
4  1  0  0

>>> pd.get_dummies(pd.Series(list('abcaa')), drop_first=True)
   b  c
0  0  0
1  1  0
2  0  1
3  0  0
4  0  0

>>> pd.get_dummies(pd.Series(list('abc')), dtype=float)
     a    b    c
0  1.0  0.0  0.0
1  0.0  1.0  0.0
2  0.0  0.0  1.0


pandas.get_option   pandas.get_option(pat)=<pandas._config.config.CallableDynamicDoc object>

Retrieves the value of the specified option. 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]   Parameters

pat:str

Regexp which should match a single option. 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.    Returns

result:the value of the option

  Raises

OptionError:if no such option exists

   Notes The available options with its descriptions:  compute.use_bottleneck:bool

Use the bottleneck library to accelerate if it is installed, the default is True Valid values: False,True [default: True] [currently: True]  compute.use_numba:bool

Use the numba engine option for select operations if it is installed, the default is False Valid values: False,True [default: False] [currently: False]  compute.use_numexpr:bool

Use the numexpr library to accelerate computation if it is installed, the default is True Valid values: False,True [default: True] [currently: True]  display.chop_threshold:float or None

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]  display.colheader_justify:‘left’/’right’

Controls the justification of column headers. used by DataFrameFormatter. [default: right] [currently: right]  display.column_space No description available.

[default: 12] [currently: 12]  display.date_dayfirst:boolean

When True, prints and parses dates with the day first, eg 20/01/2005 [default: False] [currently: False]  display.date_yearfirst:boolean

When True, prints and parses dates with the year first, eg 2005/01/20 [default: False] [currently: False]  display.encoding:str/unicode

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]  display.expand_frame_repr:boolean

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]  display.float_format:callable

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]  display.html.border:int

A border=value attribute is inserted in the <table> tag for the DataFrame HTML repr. [default: 1] [currently: 1]  display.html.table_schema:boolean

Whether to publish a Table Schema representation for frontends that support it. (default: False) [default: False] [currently: False]  display.html.use_mathjax:boolean

When True, Jupyter notebook will process table contents using MathJax, rendering mathematical expressions enclosed by the dollar symbol. (default: True) [default: True] [currently: True]  display.large_repr:‘truncate’/’info’

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]  display.latex.escape:bool

This specifies if the to_latex method of a Dataframe uses escapes special characters. Valid values: False,True [default: True] [currently: True]  display.latex.longtable :bool

This specifies if the to_latex method of a Dataframe uses the longtable format. Valid values: False,True [default: False] [currently: False]  display.latex.multicolumn:bool

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]  display.latex.multicolumn_format:bool

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]  display.latex.multirow:bool

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]  display.latex.repr:boolean

Whether to produce a latex DataFrame representation for jupyter environments that support it. (default: False) [default: False] [currently: False]  display.max_categories:int

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]  display.max_columns:int

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]  display.max_colwidth:int or None

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]  display.max_dir_items:int

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]  display.max_info_columns:int

max_info_columns is used in DataFrame.info method to decide if per column information will be printed. [default: 100] [currently: 100]  display.max_info_rows:int or None

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]  display.max_rows:int

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]  display.max_seq_items:int or None

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]  display.memory_usage:bool, string or None

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]  display.min_rows:int

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]  display.multi_sparse:boolean

“sparsify” MultiIndex display (don’t display repeated elements in outer levels within groups) [default: True] [currently: True]  display.notebook_repr_html:boolean

When True, IPython notebook will use html representation for pandas objects (if it is available). [default: True] [currently: True]  display.pprint_nest_depth:int

Controls the number of nested levels to process when pretty-printing [default: 3] [currently: 3]  display.precision:int

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]  display.show_dimensions:boolean or ‘truncate’

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]  display.unicode.ambiguous_as_wide:boolean

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]  display.unicode.east_asian_width:boolean

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]  display.width:int

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]  io.excel.ods.reader:string

The default Excel reader engine for ‘ods’ files. Available options: auto, odf. [default: auto] [currently: auto]  io.excel.ods.writer:string

The default Excel writer engine for ‘ods’ files. Available options: auto, odf. [default: auto] [currently: auto]  io.excel.xls.reader:string

The default Excel reader engine for ‘xls’ files. Available options: auto, xlrd. [default: auto] [currently: auto]  io.excel.xls.writer:string

The default Excel writer engine for ‘xls’ files. Available options: auto, xlwt. [default: auto] [currently: auto] (Deprecated, use `` instead.)  io.excel.xlsb.reader:string

The default Excel reader engine for ‘xlsb’ files. Available options: auto, pyxlsb. [default: auto] [currently: auto]  io.excel.xlsm.reader:string

The default Excel reader engine for ‘xlsm’ files. Available options: auto, xlrd, openpyxl. [default: auto] [currently: auto]  io.excel.xlsm.writer:string

The default Excel writer engine for ‘xlsm’ files. Available options: auto, openpyxl. [default: auto] [currently: auto]  io.excel.xlsx.reader:string

The default Excel reader engine for ‘xlsx’ files. Available options: auto, xlrd, openpyxl. [default: auto] [currently: auto]  io.excel.xlsx.writer:string

The default Excel writer engine for ‘xlsx’ files. Available options: auto, openpyxl, xlsxwriter. [default: auto] [currently: auto]  io.hdf.default_format:format

default format writing format, if None, then put will default to ‘fixed’ and append will default to ‘table’ [default: None] [currently: None]  io.hdf.dropna_table:boolean

drop ALL nan rows when appending to a table [default: False] [currently: False]  io.parquet.engine:string

The default parquet reader/writer engine. Available options: ‘auto’, ‘pyarrow’, ‘fastparquet’, the default is ‘auto’ [default: auto] [currently: auto]  io.sql.engine:string

The default sql reader/writer engine. Available options: ‘auto’, ‘sqlalchemy’, the default is ‘auto’ [default: auto] [currently: auto]  mode.chained_assignment:string

Raise an exception, warn, or no action if trying to use chained assignment, The default is warn [default: warn] [currently: warn]  mode.data_manager:string

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]  mode.sim_interactive:boolean

Whether to simulate interactive mode for purposes of testing [default: False] [currently: False]  mode.string_storage:string

The default storage for StringDtype. [default: python] [currently: python]  mode.use_inf_as_na:boolean

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]  mode.use_inf_as_null:boolean

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.)  plotting.backend:str

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]  plotting.matplotlib.register_converters:bool or ‘auto’.

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]  styler.format.decimal:str

The character representation for the decimal separator for floats and complex. [default: .] [currently: .]  styler.format.escape:str, optional

Whether to escape certain characters according to the given context; html or latex. [default: None] [currently: None]  styler.format.formatter:str, callable, dict, optional

A formatter object to be used as default within Styler.format. [default: None] [currently: None]  styler.format.na_rep:str, optional

The string representation for values identified as missing. [default: None] [currently: None]  styler.format.precision:int

The precision for floats and complex numbers. [default: 6] [currently: 6]  styler.format.thousands:str, optional

The character representation for thousands separator for floats, int and complex. [default: None] [currently: None]  styler.html.mathjax:bool

If False will render special CSS classes to table attributes that indicate Mathjax will not be used in Jupyter Notebook. [default: True] [currently: True]  styler.latex.environment:str

The environment to replace \begin{table}. If “longtable” is used results in a specific longtable environment format. [default: None] [currently: None]  styler.latex.hrules:bool

Whether to add horizontal rules on top and bottom and below the headers. [default: False] [currently: False]  styler.latex.multicol_align:{“r”, “c”, “l”, “naive-l”, “naive-r”}

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]  styler.latex.multirow_align:{“c”, “t”, “b”}

The specifier for vertical alignment of sparsified LaTeX multirows. [default: c] [currently: c]  styler.render.encoding:str

The encoding used for output HTML and LaTeX files. [default: utf-8] [currently: utf-8]  styler.render.max_columns:int, optional

The maximum number of columns that will be rendered. May still be reduced to satsify max_elements, which takes precedence. [default: None] [currently: None]  styler.render.max_elements:int

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]  styler.render.max_rows:int, optional

The maximum number of rows that will be rendered. May still be reduced to satsify max_elements, which takes precedence. [default: None] [currently: None]  styler.render.repr:str

Determine which output to use in Jupyter Notebook in {“html”, “latex”}. [default: html] [currently: html]  styler.sparse.columns:bool

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]  styler.sparse.index:bool

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]


pandas.Grouper   classpandas.Grouper(*args, **kwargs)[source]

A Grouper allows the user to specify a groupby instruction for an object. This specification will select a column via the key parameter, or if the level and/or axis parameters are given, a level of the index of the target object. If axis and/or level are passed as keywords to both Grouper and groupby, the values passed to Grouper take precedence.  Parameters

key:str, defaults to None

Groupby key, which selects the grouping column of the target.
level:name/number, defaults to None

The level for the target index.
freq:str / frequency object, defaults to None

This will groupby the specified frequency if the target selection (via key or level) is a datetime-like object. For full specification of available frequencies, please see here.
axis:str, int, defaults to 0

Number/name of the axis.
sort:bool, default to False

Whether to sort the resulting labels.
closed:{‘left’ or ‘right’}

Closed end of interval. Only when freq parameter is passed.
label:{‘left’ or ‘right’}

Interval boundary to use for labeling. Only when freq parameter is passed.
convention:{‘start’, ‘end’, ‘e’, ‘s’}

If grouper is PeriodIndex and freq parameter is passed.
base:int, default 0

Only when freq parameter is passed. For frequencies that evenly subdivide 1 day, the “origin” of the aggregated intervals. For example, for ‘5min’ frequency, base could range from 0 through 4. Defaults to 0.  Deprecated since version 1.1.0: The new arguments that you should use are ‘offset’ or ‘origin’.
loffset:str, DateOffset, timedelta object

Only when freq parameter is passed.  Deprecated since version 1.1.0: loffset is only working for .resample(...) and not for Grouper (GH28302). However, loffset is also deprecated for .resample(...) See: DataFrame.resample
origin:Timestamp or str, default ‘start_day’

The timestamp on which to adjust the grouping. The timezone of origin must match the timezone of the index. If string, must be one of the following:  ‘epoch’: origin is 1970-01-01 ‘start’: origin is the first value of the timeseries ‘start_day’: origin is the first day at midnight of the timeseries   New in version 1.1.0.   ‘end’: origin is the last value of the timeseries ‘end_day’: origin is the ceiling midnight of the last day   New in version 1.3.0.
offset:Timedelta or str, default is None

An offset timedelta added to the origin.  New in version 1.1.0.
dropna:bool, default True

If True, and if group keys contain NA values, NA values together with row/column will be dropped. If False, NA values will also be treated as the key in groups.  New in version 1.2.0.     Returns
 A specification for a groupby instruction
   Examples Syntactic sugar for df.groupby('A')
>>> df = pd.DataFrame(
...     {
...         "Animal": ["Falcon", "Parrot", "Falcon", "Falcon", "Parrot"],
...         "Speed": [100, 5, 200, 300, 15],
...     }
... )
>>> df
   Animal  Speed
0  Falcon    100
1  Parrot      5
2  Falcon    200
3  Falcon    300
4  Parrot     15
>>> df.groupby(pd.Grouper(key="Animal")).mean()
        Speed
Animal
Falcon  200.0
Parrot   10.0
  Specify a resample operation on the column ‘Publish date’
>>> df = pd.DataFrame(
...    {
...        "Publish date": [
...             pd.Timestamp("2000-01-02"),
...             pd.Timestamp("2000-01-02"),
...             pd.Timestamp("2000-01-09"),
...             pd.Timestamp("2000-01-16")
...         ],
...         "ID": [0, 1, 2, 3],
...         "Price": [10, 20, 30, 40]
...     }
... )
>>> df
  Publish date  ID  Price
0   2000-01-02   0     10
1   2000-01-02   1     20
2   2000-01-09   2     30
3   2000-01-16   3     40
>>> df.groupby(pd.Grouper(key="Publish date", freq="1W")).mean()
               ID  Price
Publish date
2000-01-02    0.5   15.0
2000-01-09    2.0   30.0
2000-01-16    3.0   40.0
  If you want to adjust the start of the bins based on a fixed timestamp:
>>> start, end = '2000-10-01 23:30:00', '2000-10-02 00:30:00'
>>> rng = pd.date_range(start, end, freq='7min')
>>> ts = pd.Series(np.arange(len(rng)) * 3, index=rng)
>>> ts
2000-10-01 23:30:00     0
2000-10-01 23:37:00     3
2000-10-01 23:44:00     6
2000-10-01 23:51:00     9
2000-10-01 23:58:00    12
2000-10-02 00:05:00    15
2000-10-02 00:12:00    18
2000-10-02 00:19:00    21
2000-10-02 00:26:00    24
Freq: 7T, dtype: int64

>>> ts.groupby(pd.Grouper(freq='17min')).sum()
2000-10-01 23:14:00     0
2000-10-01 23:31:00     9
2000-10-01 23:48:00    21
2000-10-02 00:05:00    54
2000-10-02 00:22:00    24
Freq: 17T, dtype: int64

>>> ts.groupby(pd.Grouper(freq='17min', origin='epoch')).sum()
2000-10-01 23:18:00     0
2000-10-01 23:35:00    18
2000-10-01 23:52:00    27
2000-10-02 00:09:00    39
2000-10-02 00:26:00    24
Freq: 17T, dtype: int64

>>> ts.groupby(pd.Grouper(freq='17min', origin='2000-01-01')).sum()
2000-10-01 23:24:00     3
2000-10-01 23:41:00    15
2000-10-01 23:58:00    45
2000-10-02 00:15:00    45
Freq: 17T, dtype: int64
  If you want to adjust the start of the bins with an offset Timedelta, the two following lines are equivalent:
>>> ts.groupby(pd.Grouper(freq='17min', origin='start')).sum()
2000-10-01 23:30:00     9
2000-10-01 23:47:00    21
2000-10-02 00:04:00    54
2000-10-02 00:21:00    24
Freq: 17T, dtype: int64

>>> ts.groupby(pd.Grouper(freq='17min', offset='23h30min')).sum()
2000-10-01 23:30:00     9
2000-10-01 23:47:00    21
2000-10-02 00:04:00    54
2000-10-02 00:21:00    24
Freq: 17T, dtype: int64
  To replace the use of the deprecated base argument, you can now use offset, in this example it is equivalent to have base=2:
>>> ts.groupby(pd.Grouper(freq='17min', offset='2min')).sum()
2000-10-01 23:16:00     0
2000-10-01 23:33:00     9
2000-10-01 23:50:00    36
2000-10-02 00:07:00    39
2000-10-02 00:24:00    24
Freq: 17T, dtype: int64
  Attributes
ax
groups


pandas.HDFStore.append   HDFStore.append(key, value, format=None, axes=None, index=True, append=True, complib=None, complevel=None, columns=None, min_itemsize=None, nan_rep=None, chunksize=None, expectedrows=None, dropna=None, data_columns=None, encoding=None, errors='strict')[source]

Append to Table in file. Node must already exist and be Table format.  Parameters

key:str

value:{Series, DataFrame}

format:‘table’ is the default

Format to use when storing object in HDFStore. Value can be one of:  'table'

Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data.
append:bool, default True

Append the input data to the existing.
data_columns:list of columns, or True, default None

List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes of the object are indexed. See here.
min_itemsize:dict of columns that specify minimum str sizes

nan_rep:str to use as str nan representation

chunksize:size to chunk the writing

expectedrows:expected TOTAL row size of this table

encoding:default None, provide an encoding for str

dropna:bool, default False

Do not write an ALL nan row to the store settable by the option ‘io.hdf.dropna_table’.     Notes Does not check if data being appended overlaps with existing data in the table, so be careful


pandas.HDFStore.get   HDFStore.get(key)[source]

Retrieve pandas object stored in file.  Parameters

key:str

  Returns
 object

Same type as object stored in file.


pandas.HDFStore.groups   HDFStore.groups()[source]

Return a list of all the top-level nodes. Each node returned is not a pandas storage object.  Returns
 list

List of objects.


pandas.HDFStore.info   HDFStore.info()[source]

Print detailed information on the store.  Returns
 str


pandas.HDFStore.keys   HDFStore.keys(include='pandas')[source]

Return a list of keys corresponding to objects stored in HDFStore.  Parameters

include:str, default ‘pandas’

When kind equals ‘pandas’ return pandas objects. When kind equals ‘native’ return native HDF5 Table objects.  New in version 1.1.0.     Returns
 list

List of ABSOLUTE path-names (e.g. have the leading ‘/’).    Raises
 raises ValueError if kind has an illegal value


pandas.HDFStore.put   HDFStore.put(key, value, format=None, index=True, append=False, complib=None, complevel=None, min_itemsize=None, nan_rep=None, data_columns=None, encoding=None, errors='strict', track_times=True, dropna=False)[source]

Store object in HDFStore.  Parameters

key:str

value:{Series, DataFrame}

format:‘fixed(f)|table(t)’, default is ‘fixed’

Format to use when storing object in HDFStore. Value can be one of:  'fixed'

Fixed format. Fast writing/reading. Not-appendable, nor searchable.  'table'

Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data.
append:bool, default False

This will force Table format, append the input data to the existing.
data_columns:list of columns or True, default None

List of columns to create as data columns, or True to use all columns. See here.
encoding:str, default None

Provide an encoding for strings.
track_times:bool, default True

Parameter is propagated to ‘create_table’ method of ‘PyTables’. If set to False it enables to have the same h5 files (same hashes) independent on creation time.  New in version 1.1.0.


pandas.HDFStore.select   HDFStore.select(key, where=None, start=None, stop=None, columns=None, iterator=False, chunksize=None, auto_close=False)[source]

Retrieve pandas object stored in file, optionally based on where criteria.  Warning Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the “fixed” format. Loading pickled data received from untrusted sources can be unsafe. See: https://docs.python.org/3/library/pickle.html for more.   Parameters

key:str

Object being retrieved from file.
where:list or None

List of Term (or convertible) objects, optional.
start:int or None

Row number to start selection.
stop:int, default None

Row number to stop selection.
columns:list or None

A list of columns that if not None, will limit the return columns.
iterator:bool or False

Returns an iterator.
chunksize:int or None

Number or rows to include in iteration, return an iterator.
auto_close:bool or False

Should automatically close the store when finished.    Returns
 object

Retrieved object from file.


pandas.HDFStore.walk   HDFStore.walk(where='/')[source]

Walk the pytables group hierarchy for pandas objects. This generator will yield the group path, subgroups and pandas object names for each group. Any non-pandas PyTables objects that are not a group will be ignored. The where group itself is listed first (preorder), then each of its child groups (following an alphanumerical order) is also traversed, following the same procedure.  Parameters

where:str, default “/”

Group where to start walking.    Yields

path:str

Full path to a group (without trailing ‘/’).
groups:list

Names (strings) of the groups contained in path.
leaves:list

Names (strings) of the pandas objects contained in path.


pandas.Index   classpandas.Index(data=None, dtype=None, copy=False, name=None, tupleize_cols=True, **kwargs)[source]

Immutable sequence used for indexing and alignment. The basic object storing axis labels for all pandas objects.  Parameters

data:array-like (1-dimensional)

dtype:NumPy dtype (default: object)

If dtype is None, we find the dtype that best fits the data. If an actual dtype is provided, we coerce to that dtype if it’s safe. Otherwise, an error will be raised.
copy:bool

Make a copy of input ndarray.
name:object

Name to be stored in the index.
tupleize_cols:bool (default: True)

When True, attempt to create a MultiIndex if possible.      See also  RangeIndex

Index implementing a monotonic integer range.  CategoricalIndex

Index of Categorical s.  MultiIndex

A multi-level, or hierarchical Index.  IntervalIndex

An Index of Interval s.  DatetimeIndex

Index of datetime64 data.  TimedeltaIndex

Index of timedelta64 data.  PeriodIndex

Index of Period data.  NumericIndex

Index of numpy int/uint/float data.  Int64Index

Index of purely int64 labels (deprecated).  UInt64Index

Index of purely uint64 labels (deprecated).  Float64Index

Index of purely float64 labels (deprecated).    Notes An Index instance can only contain hashable objects Examples
>>> pd.Index([1, 2, 3])
Int64Index([1, 2, 3], dtype='int64')

>>> pd.Index(list('abc'))
Index(['a', 'b', 'c'], dtype='object')
  Attributes
T Return the transpose, which is by definition self.
array The ExtensionArray of the data backing this Series or Index.
asi8 Integer representation of the values.
dtype Return the dtype object of the underlying data.
has_duplicates Check if the Index has duplicate values.
hasnans Return True if there are any NaNs.
inferred_type Return a string of the type inferred from the values.
is_all_dates Whether or not the index values only consist of dates.
is_monotonic Alias for is_monotonic_increasing.
is_monotonic_decreasing Return if the index is monotonic decreasing (only equal or decreasing) values.
is_monotonic_increasing Return if the index is monotonic increasing (only equal or increasing) values.
is_unique Return if the index has unique values.
name Return Index or MultiIndex name.
nbytes Return the number of bytes in the underlying data.
ndim Number of dimensions of the underlying data, by definition 1.
nlevels Number of levels.
shape Return a tuple of the shape of the underlying data.
size Return the number of elements in the underlying data.
values Return an array representing the data in the Index.
empty
names     Methods
all(*args, **kwargs) Return whether all elements are Truthy.
any(*args, **kwargs) Return whether any element is Truthy.
append(other) Append a collection of Index options together.
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(*args, **kwargs) Return the integer indices that would sort the index.
asof(label) Return the label from the index, or, if not present, the previous one.
asof_locs(where, mask) Return the locations (indices) of labels in the index.
astype(dtype[, copy]) Create an Index with values cast to dtypes.
copy([name, deep, dtype, names]) Make a copy of this object.
delete(loc) Make new Index with passed location(-s) deleted.
difference(other[, sort]) Return a new Index with elements of index not in other.
drop(labels[, errors]) Make new Index with passed list of labels deleted.
drop_duplicates([keep]) Return Index with duplicate values removed.
droplevel([level]) Return index with requested level(s) removed.
dropna([how]) Return Index without NA/NaN values.
duplicated([keep]) Indicate duplicate index values.
equals(other) Determine if two Index object are equal.
factorize([sort, na_sentinel]) Encode the object as an enumerated type or categorical variable.
fillna([value, downcast]) Fill NA/NaN values with the specified value.
format([name, formatter, na_rep]) Render a string representation of the Index.
get_indexer(target[, method, limit, tolerance]) Compute indexer and mask for new index given the current index.
get_indexer_for(target) Guaranteed return of an indexer even when non-unique.
get_indexer_non_unique(target) Compute indexer and mask for new index given the current index.
get_level_values(level) Return an Index of values for requested level.
get_loc(key[, method, tolerance]) Get integer location, slice or boolean mask for requested label.
get_slice_bound(label, side[, kind]) Calculate slice bound that corresponds to given label.
get_value(series, key) Fast lookup of value from 1-dimensional ndarray.
groupby(values) Group the index labels by a given array of values.
holds_integer() Whether the type is an integer type.
identical(other) Similar to equals, but checks that object attributes and types are also equal.
insert(loc, item) Make new Index inserting new item at location.
intersection(other[, sort]) Form the intersection of two Index objects.
is_(other) More flexible, faster check like is but that works through views.
is_boolean() Check if the Index only consists of booleans.
is_categorical() Check if the Index holds categorical data.
is_floating() Check if the Index is a floating type.
is_integer() Check if the Index only consists of integers.
is_interval() Check if the Index holds Interval objects.
is_mixed() Check if the Index holds data with mixed data types.
is_numeric() Check if the Index only consists of numeric data.
is_object() Check if the Index is of the object dtype.
is_type_compatible(kind) Whether the index type is compatible with the provided type.
isin(values[, level]) Return a boolean array where the index values are in values.
isna() Detect missing values.
isnull() Detect missing values.
item() Return the first element of the underlying data as a Python scalar.
join(other[, how, level, return_indexers, sort]) Compute join_index and indexers to conform data structures to the new index.
map(mapper[, na_action]) Map values using an input mapping or function.
max([axis, skipna]) Return the maximum value of the Index.
memory_usage([deep]) Memory usage of the values.
min([axis, skipna]) Return the minimum value of the Index.
notna() Detect existing (non-missing) values.
notnull() Detect existing (non-missing) values.
nunique([dropna]) Return number of unique elements in the object.
putmask(mask, value) Return a new Index of the values set with the mask.
ravel([order]) Return an ndarray of the flattened values of the underlying data.
reindex(target[, method, level, limit, ...]) Create index with target's values.
rename(name[, inplace]) Alter Index or MultiIndex name.
repeat(repeats[, axis]) Repeat elements of a Index.
searchsorted(value[, side, sorter]) Find indices where elements should be inserted to maintain order.
set_names(names[, level, inplace]) Set Index or MultiIndex name.
set_value(arr, key, value) (DEPRECATED) Fast lookup of value from 1-dimensional ndarray.
shift([periods, freq]) Shift index by desired number of time frequency increments.
slice_indexer([start, end, step, kind]) Compute the slice indexer for input labels and step.
slice_locs([start, end, step, kind]) Compute slice locations for input labels.
sort(*args, **kwargs) Use sort_values instead.
sort_values([return_indexer, ascending, ...]) Return a sorted copy of the index.
sortlevel([level, ascending, sort_remaining]) For internal compatibility with the Index API.
str alias of pandas.core.strings.accessor.StringMethods
symmetric_difference(other[, result_name, sort]) Compute the symmetric difference of two Index objects.
take(indices[, axis, allow_fill, fill_value]) Return a new Index of the values selected by the indices.
to_flat_index() Identity method.
to_frame([index, name]) Create a DataFrame with a column containing the Index.
to_list() Return a list of the values.
to_native_types([slicer]) (DEPRECATED) Format specified values of self and return them.
to_numpy([dtype, copy, na_value]) A NumPy ndarray representing the values in this Series or Index.
to_series([index, name]) Create a Series with both index and values equal to the index keys.
tolist() Return a list of the values.
transpose(*args, **kwargs) Return the transpose, which is by definition self.
union(other[, sort]) Form the union of two Index objects.
unique([level]) Return unique values in the index.
value_counts([normalize, sort, ascending, ...]) Return a Series containing counts of unique values.
where(cond[, other]) Replace values where the condition is False.
view


pandas.Index.all   Index.all(*args, **kwargs)[source]

Return whether all elements are Truthy.  Parameters
 *args

Required for compatibility with numpy.  **kwargs

Required for compatibility with numpy.    Returns

all:bool or array-like (if axis is specified)

A single element array-like may be converted to bool.      See also  Index.any

Return whether any element in an Index is True.  Series.any

Return whether any element in a Series is True.  Series.all

Return whether all elements in a Series are True.    Notes Not a Number (NaN), positive infinity and negative infinity evaluate to True because these are not equal to zero. Examples True, because nonzero integers are considered True.
>>> pd.Index([1, 2, 3]).all()
True
  False, because 0 is considered False.
>>> pd.Index([0, 1, 2]).all()
False


pandas.Index.any   Index.any(*args, **kwargs)[source]

Return whether any element is Truthy.  Parameters
 *args

Required for compatibility with numpy.  **kwargs

Required for compatibility with numpy.    Returns

any:bool or array-like (if axis is specified)

A single element array-like may be converted to bool.      See also  Index.all

Return whether all elements are True.  Series.all

Return whether all elements are True.    Notes Not a Number (NaN), positive infinity and negative infinity evaluate to True because these are not equal to zero. Examples
>>> index = pd.Index([0, 1, 2])
>>> index.any()
True

>>> index = pd.Index([0, 0, 0])
>>> index.any()
False


pandas.Index.append   Index.append(other)[source]

Append a collection of Index options together.  Parameters

other:Index or list/tuple of indices

  Returns
 Index


pandas.Index.argmax   Index.argmax(axis=None, skipna=True, *args, **kwargs)[source]

Return int position of the largest value in the Series. If the maximum is achieved in multiple locations, the first row position is returned.  Parameters

axis:{None}

Dummy argument for consistency with Series.
skipna:bool, default True

Exclude NA/null values when showing the result.  *args, **kwargs

Additional arguments and keywords for compatibility with NumPy.    Returns
 int

Row position of the maximum value.      See also  Series.argmax

Return position of the maximum value.  Series.argmin

Return position of the minimum value.  numpy.ndarray.argmax

Equivalent method for numpy arrays.  Series.idxmax

Return index label of the maximum values.  Series.idxmin

Return index label of the minimum values.    Examples Consider dataset containing cereal calories
>>> s = pd.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
...                'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s
Corn Flakes              100.0
Almond Delight           110.0
Cinnamon Toast Crunch    120.0
Cocoa Puff               110.0
dtype: float64

>>> s.argmax()
2
>>> s.argmin()
0
  The maximum cereal calories is the third element and the minimum cereal calories is the first element, since series is zero-indexed.


pandas.Index.argmin   Index.argmin(axis=None, skipna=True, *args, **kwargs)[source]

Return int position of the smallest value in the Series. If the minimum is achieved in multiple locations, the first row position is returned.  Parameters

axis:{None}

Dummy argument for consistency with Series.
skipna:bool, default True

Exclude NA/null values when showing the result.  *args, **kwargs

Additional arguments and keywords for compatibility with NumPy.    Returns
 int

Row position of the minimum value.      See also  Series.argmin

Return position of the minimum value.  Series.argmax

Return position of the maximum value.  numpy.ndarray.argmin

Equivalent method for numpy arrays.  Series.idxmax

Return index label of the maximum values.  Series.idxmin

Return index label of the minimum values.    Examples Consider dataset containing cereal calories
>>> s = pd.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
...                'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s
Corn Flakes              100.0
Almond Delight           110.0
Cinnamon Toast Crunch    120.0
Cocoa Puff               110.0
dtype: float64

>>> s.argmax()
2
>>> s.argmin()
0
  The maximum cereal calories is the third element and the minimum cereal calories is the first element, since series is zero-indexed.


pandas.Index.argsort   Index.argsort(*args, **kwargs)[source]

Return the integer indices that would sort the index.  Parameters
 *args

Passed to numpy.ndarray.argsort.  **kwargs

Passed to numpy.ndarray.argsort.    Returns
 np.ndarray[np.intp]

Integer indices that would sort the index if used as an indexer.      See also  numpy.argsort

Similar method for NumPy arrays.  Index.sort_values

Return sorted copy of Index.    Examples
>>> idx = pd.Index(['b', 'a', 'd', 'c'])
>>> idx
Index(['b', 'a', 'd', 'c'], dtype='object')

>>> order = idx.argsort()
>>> order
array([1, 0, 3, 2])

>>> idx[order]
Index(['a', 'b', 'c', 'd'], dtype='object')


pandas.Index.array   Index.array

The ExtensionArray of the data backing this Series or Index.  Returns
 ExtensionArray

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  Index.to_numpy

Similar method that always returns a NumPy array.  Series.to_numpy

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.
>>> pd.Series([1, 2, 3]).array
<PandasArray>
[1, 2, 3]
Length: 3, dtype: int64
  For extension types, like Categorical, the actual ExtensionArray is returned
>>> ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.array
['a', 'b', 'a']
Categories (2, object): ['a', 'b']


pandas.Index.asi8   propertyIndex.asi8

Integer representation of the values.  Returns
 ndarray

An ndarray with int64 dtype.


pandas.Index.asof   finalIndex.asof(label)[source]

Return the label from the index, or, if not present, the previous one. Assuming that the index is sorted, return the passed index label if it is in the index, or return the previous index label if the passed one is not in the index.  Parameters

label:object

The label up to which the method returns the latest index label.    Returns
 object

The passed label if it is in the index. The previous label if the passed label is not in the sorted index or NaN if there is no such label.      See also  Series.asof

Return the latest value in a Series up to the passed index.  merge_asof

Perform an asof merge (similar to left join but it matches on nearest key rather than equal key).  Index.get_loc

An asof is a thin wrapper around get_loc with method=’pad’.    Examples Index.asof returns the latest index label up to the passed label.
>>> idx = pd.Index(['2013-12-31', '2014-01-02', '2014-01-03'])
>>> idx.asof('2014-01-01')
'2013-12-31'
  If the label is in the index, the method returns the passed label.
>>> idx.asof('2014-01-02')
'2014-01-02'
  If all of the labels in the index are later than the passed label, NaN is returned.
>>> idx.asof('1999-01-02')
nan
  If the index is not sorted, an error is raised.
>>> idx_not_sorted = pd.Index(['2013-12-31', '2015-01-02',
...                            '2014-01-03'])
>>> idx_not_sorted.asof('2013-12-31')
Traceback (most recent call last):
ValueError: index must be monotonic increasing or decreasing


pandas.Index.asof_locs   Index.asof_locs(where, mask)[source]

Return the locations (indices) of labels in the index. As in the asof function, if the label (a particular entry in where) is not in the index, the latest index label up to the passed label is chosen and its index returned. If all of the labels in the index are later than a label in where, -1 is returned. mask is used to ignore NA values in the index during calculation.  Parameters

where:Index

An Index consisting of an array of timestamps.
mask:np.ndarray[bool]

Array of booleans denoting where values in the original data are not NA.    Returns
 np.ndarray[np.intp]

An array of locations (indices) of the labels from the Index which correspond to the return values of the asof function for every element in where.


pandas.Index.astype   Index.astype(dtype, copy=True)[source]

Create an Index with values cast to dtypes. The class of a new Index is determined by dtype. When conversion is impossible, a TypeError exception is raised.  Parameters

dtype:numpy dtype or pandas type

Note that any signed integer dtype is treated as 'int64', and any unsigned integer dtype is treated as 'uint64', regardless of the size.
copy:bool, default True

By default, astype always returns a newly allocated object. If copy is set to False and internal requirements on dtype are satisfied, the original data is used to create a new Index or the original Index is returned.    Returns
 Index

Index with values cast to specified dtype.


pandas.Index.copy   Index.copy(name=None, deep=False, dtype=None, names=None)[source]

Make a copy of this object. Name and dtype sets those attributes on the new object.  Parameters

name:Label, optional

Set name for new object.
deep:bool, default False

dtype:numpy dtype or pandas type, optional

Set dtype for new object.  Deprecated since version 1.2.0: use astype method instead.
names:list-like, optional

Kept for compatibility with MultiIndex. Should not be used.  Deprecated since version 1.4.0: use name instead.     Returns
 Index

Index refer to new object which is a copy of this object.     Notes In most cases, there should be no functional difference from using deep, but if deep is passed it will attempt to deepcopy.


pandas.Index.delete   Index.delete(loc)[source]

Make new Index with passed location(-s) deleted.  Parameters

loc:int or list of int

Location of item(-s) which will be deleted. Use a list of locations to delete more than one value at the same time.    Returns
 Index

Will be same type as self, except for RangeIndex.      See also  numpy.delete

Delete any rows and column from NumPy array (ndarray).    Examples
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.delete(1)
Index(['a', 'c'], dtype='object')

>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.delete([0, 2])
Index(['b'], dtype='object')


pandas.Index.difference   finalIndex.difference(other, sort=None)[source]

Return a new Index with elements of index not in other. This is the set difference of two Index objects.  Parameters

other:Index or array-like

sort:False or None, default None

Whether to sort the resulting index. By default, the values are attempted to be sorted, but any TypeError from incomparable elements is caught by pandas.  None : Attempt to sort the result, but catch any TypeErrors from comparing incomparable elements. False : Do not sort the result.     Returns

difference:Index

   Examples
>>> idx1 = pd.Index([2, 1, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.difference(idx2)
Int64Index([1, 2], dtype='int64')
>>> idx1.difference(idx2, sort=False)
Int64Index([2, 1], dtype='int64')


pandas.Index.drop   Index.drop(labels, errors='raise')[source]

Make new Index with passed list of labels deleted.  Parameters

labels:array-like or scalar

errors:{‘ignore’, ‘raise’}, default ‘raise’

If ‘ignore’, suppress error and existing labels are dropped.    Returns

dropped:Index

Will be same type as self, except for RangeIndex.    Raises
 KeyError

If not all of the labels are found in the selected axis


pandas.Index.drop_duplicates   Index.drop_duplicates(keep='first')[source]

Return Index with duplicate values removed.  Parameters

keep:{‘first’, ‘last’, False}, default ‘first’

 ‘first’ : Drop duplicates except for the first occurrence. ‘last’ : Drop duplicates except for the last occurrence. False : Drop all duplicates.     Returns

deduplicated:Index

    See also  Series.drop_duplicates

Equivalent method on Series.  DataFrame.drop_duplicates

Equivalent method on DataFrame.  Index.duplicated

Related method on Index, indicating duplicate Index values.    Examples Generate an pandas.Index with duplicate values.
>>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama', 'hippo'])
  The keep parameter controls which duplicate values are removed. The value ‘first’ keeps the first occurrence for each set of duplicated entries. The default value of keep is ‘first’.
>>> idx.drop_duplicates(keep='first')
Index(['lama', 'cow', 'beetle', 'hippo'], dtype='object')
  The value ‘last’ keeps the last occurrence for each set of duplicated entries.
>>> idx.drop_duplicates(keep='last')
Index(['cow', 'beetle', 'lama', 'hippo'], dtype='object')
  The value False discards all sets of duplicated entries.
>>> idx.drop_duplicates(keep=False)
Index(['cow', 'beetle', 'hippo'], dtype='object')


pandas.Index.droplevel   finalIndex.droplevel(level=0)[source]

Return index with requested level(s) removed. If resulting index has only 1 level left, the result will be of Index type, not MultiIndex.  Parameters

level:int, str, or list-like, default 0

If a string is given, must be the name of a level If list-like, elements must be names or indexes of levels.    Returns
 Index or MultiIndex
   Examples
>>> mi = pd.MultiIndex.from_arrays(
... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'])
>>> mi
MultiIndex([(1, 3, 5),
            (2, 4, 6)],
           names=['x', 'y', 'z'])

>>> mi.droplevel()
MultiIndex([(3, 5),
            (4, 6)],
           names=['y', 'z'])

>>> mi.droplevel(2)
MultiIndex([(1, 3),
            (2, 4)],
           names=['x', 'y'])

>>> mi.droplevel('z')
MultiIndex([(1, 3),
            (2, 4)],
           names=['x', 'y'])

>>> mi.droplevel(['x', 'y'])
Int64Index([5, 6], dtype='int64', name='z')


pandas.Index.dropna   Index.dropna(how='any')[source]

Return Index without NA/NaN values.  Parameters

how:{‘any’, ‘all’}, default ‘any’

If the Index is a MultiIndex, drop the value when any or all levels are NaN.    Returns
 Index


pandas.Index.dtype   Index.dtype

Return the dtype object of the underlying data.


pandas.Index.duplicated   Index.duplicated(keep='first')[source]

Indicate duplicate index values. Duplicated values are indicated as True values in the resulting array. Either all duplicates, all except the first, or all except the last occurrence of duplicates can be indicated.  Parameters

keep:{‘first’, ‘last’, False}, default ‘first’

The value or values in a set of duplicates to mark as missing.  ‘first’ : Mark duplicates as True except for the first occurrence. ‘last’ : Mark duplicates as True except for the last occurrence. False : Mark all duplicates as True.     Returns
 np.ndarray[bool]
    See also  Series.duplicated

Equivalent method on pandas.Series.  DataFrame.duplicated

Equivalent method on pandas.DataFrame.  Index.drop_duplicates

Remove duplicate values from Index.    Examples By default, for each set of duplicated values, the first occurrence is set to False and all others to True:
>>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama'])
>>> idx.duplicated()
array([False, False,  True, False,  True])
  which is equivalent to
>>> idx.duplicated(keep='first')
array([False, False,  True, False,  True])
  By using ‘last’, the last occurrence of each set of duplicated values is set on False and all others on True:
>>> idx.duplicated(keep='last')
array([ True, False,  True, False, False])
  By setting keep on False, all duplicates are True:
>>> idx.duplicated(keep=False)
array([ True, False,  True, False,  True])


pandas.Index.empty   propertyIndex.empty


pandas.Index.equals   Index.equals(other)[source]

Determine if two Index object are equal. The things that are being compared are:  The elements inside the Index object. The order of the elements inside the Index object.   Parameters

other:Any

The other object to compare against.    Returns
 bool

True if “other” is an Index and it has the same elements and order as the calling index; False otherwise.     Examples
>>> idx1 = pd.Index([1, 2, 3])
>>> idx1
Int64Index([1, 2, 3], dtype='int64')
>>> idx1.equals(pd.Index([1, 2, 3]))
True
  The elements inside are compared
>>> idx2 = pd.Index(["1", "2", "3"])
>>> idx2
Index(['1', '2', '3'], dtype='object')

>>> idx1.equals(idx2)
False
  The order is compared
>>> ascending_idx = pd.Index([1, 2, 3])
>>> ascending_idx
Int64Index([1, 2, 3], dtype='int64')
>>> descending_idx = pd.Index([3, 2, 1])
>>> descending_idx
Int64Index([3, 2, 1], dtype='int64')
>>> ascending_idx.equals(descending_idx)
False
  The dtype is not compared
>>> int64_idx = pd.Int64Index([1, 2, 3])
>>> int64_idx
Int64Index([1, 2, 3], dtype='int64')
>>> uint64_idx = pd.UInt64Index([1, 2, 3])
>>> uint64_idx
UInt64Index([1, 2, 3], dtype='uint64')
>>> int64_idx.equals(uint64_idx)
True


pandas.Index.factorize   Index.factorize(sort=False, na_sentinel=- 1)[source]

Encode the object as an enumerated type or categorical variable. This method is useful for obtaining a numeric representation of an array when all that matters is identifying distinct values. factorize is available as both a top-level function pandas.factorize(), and as a method Series.factorize() and Index.factorize().  Parameters

sort:bool, default False

Sort uniques and shuffle codes to maintain the relationship.
na_sentinel:int or None, default -1

Value to mark “not found”. If None, will not drop the NaN from the uniques of the values.  Changed in version 1.1.2.     Returns

codes:ndarray

An integer ndarray that’s an indexer into uniques. uniques.take(codes) will have the same values as values.
uniques:ndarray, Index, or Categorical

The unique valid values. When values is Categorical, uniques is a Categorical. When values is some other pandas object, an Index is returned. Otherwise, a 1-D ndarray is returned.  Note Even if there’s a missing value in values, uniques will not contain an entry for it.       See also  cut

Discretize continuous-valued array.  unique

Find the unique value in an array.    Examples These examples all show factorize as a top-level method like pd.factorize(values). The results are identical for methods like Series.factorize().
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'])
>>> codes
array([0, 0, 1, 2, 0]...)
>>> uniques
array(['b', 'a', 'c'], dtype=object)
  With sort=True, the uniques will be sorted, and codes will be shuffled so that the relationship is the maintained.
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'], sort=True)
>>> codes
array([1, 1, 0, 2, 1]...)
>>> uniques
array(['a', 'b', 'c'], dtype=object)
  Missing values are indicated in codes with na_sentinel (-1 by default). Note that missing values are never included in uniques.
>>> codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b'])
>>> codes
array([ 0, -1,  1,  2,  0]...)
>>> uniques
array(['b', 'a', 'c'], dtype=object)
  Thus far, we’ve only factorized lists (which are internally coerced to NumPy arrays). When factorizing pandas objects, the type of uniques will differ. For Categoricals, a Categorical is returned.
>>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c'])
>>> codes, uniques = pd.factorize(cat)
>>> codes
array([0, 0, 1]...)
>>> uniques
['a', 'c']
Categories (3, object): ['a', 'b', 'c']
  Notice that 'b' is in uniques.categories, despite not being present in cat.values. For all other pandas objects, an Index of the appropriate type is returned.
>>> cat = pd.Series(['a', 'a', 'c'])
>>> codes, uniques = pd.factorize(cat)
>>> codes
array([0, 0, 1]...)
>>> uniques
Index(['a', 'c'], dtype='object')
  If NaN is in the values, and we want to include NaN in the uniques of the values, it can be achieved by setting na_sentinel=None.
>>> values = np.array([1, 2, 1, np.nan])
>>> codes, uniques = pd.factorize(values)  # default: na_sentinel=-1
>>> codes
array([ 0,  1,  0, -1])
>>> uniques
array([1., 2.])

>>> codes, uniques = pd.factorize(values, na_sentinel=None)
>>> codes
array([0, 1, 0, 2])
>>> uniques
array([ 1.,  2., nan])


pandas.Index.fillna   Index.fillna(value=None, downcast=None)[source]

Fill NA/NaN values with the specified value.  Parameters

value:scalar

Scalar value to use to fill holes (e.g. 0). This value cannot be a list-likes.
downcast:dict, default is None

A dict of item->dtype of what to downcast if possible, or the string ‘infer’ which will try to downcast to an appropriate equal type (e.g. float64 to int64 if possible).    Returns
 Index
    See also  DataFrame.fillna

Fill NaN values of a DataFrame.  Series.fillna

Fill NaN Values of a Series.


pandas.Index.format   Index.format(name=False, formatter=None, na_rep='NaN')[source]

Render a string representation of the Index.


pandas.Index.get_indexer   finalIndex.get_indexer(target, method=None, limit=None, tolerance=None)[source]

Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index.  Parameters

target:Index

method:{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional

 default: exact matches only. pad / ffill: find the PREVIOUS index value if no exact match. backfill / bfill: use NEXT index value if no exact match nearest: use the NEAREST index value if no exact match. Tied distances are broken by preferring the larger index value.
limit:int, optional

Maximum number of consecutive labels in target to match for inexact matches.
tolerance:optional

Maximum distance between original and new labels for inexact matches. The values of the index at the matching locations must satisfy the equation abs(index[indexer] - target) <= tolerance. Tolerance may be a scalar value, which applies the same tolerance to all values, or list-like, which applies variable tolerance per element. List-like includes list, tuple, array, Series, and must be the same size as the index and its dtype must exactly match the index’s type.    Returns

indexer:np.ndarray[np.intp]

Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1.     Notes Returns -1 for unmatched values, for further explanation see the example below. Examples
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1,  2, -1])
  Notice that the return value is an array of locations in index and x is marked by -1, as it is not in index.


pandas.Index.get_indexer_for   finalIndex.get_indexer_for(target)[source]

Guaranteed return of an indexer even when non-unique. This dispatches to get_indexer or get_indexer_non_unique as appropriate.  Returns
 np.ndarray[np.intp]

List of indices.     Examples
>>> idx = pd.Index([np.nan, 'var1', np.nan])
>>> idx.get_indexer_for([np.nan])
array([0, 2])


pandas.Index.get_indexer_non_unique   Index.get_indexer_non_unique(target)[source]

Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index.  Parameters

target:Index

  Returns

indexer:np.ndarray[np.intp]

Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1.
missing:np.ndarray[np.intp]

An indexer into the target of the values not found. These correspond to the -1 in the indexer array.


pandas.Index.get_level_values   Index.get_level_values(level)[source]

Return an Index of values for requested level. This is primarily useful to get an individual level of values from a MultiIndex, but is provided on Index as well for compatibility.  Parameters

level:int or str

It is either the integer position or the name of the level.    Returns
 Index

Calling object, as there is only one level in the Index.      See also  MultiIndex.get_level_values

Get values for a level of a MultiIndex.    Notes For Index, level should be 0, since there are no multiple levels. Examples
>>> idx = pd.Index(list('abc'))
>>> idx
Index(['a', 'b', 'c'], dtype='object')
  Get level values by supplying level as integer:
>>> idx.get_level_values(0)
Index(['a', 'b', 'c'], dtype='object')


pandas.Index.get_loc   Index.get_loc(key, method=None, tolerance=None)[source]

Get integer location, slice or boolean mask for requested label.  Parameters

key:label

method:{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional

 default: exact matches only. pad / ffill: find the PREVIOUS index value if no exact match. backfill / bfill: use NEXT index value if no exact match nearest: use the NEAREST index value if no exact match. Tied distances are broken by preferring the larger index value.
tolerance:int or float, optional

Maximum distance from index value for inexact matches. The value of the index at the matching location must satisfy the equation abs(index[loc] - key) <= tolerance.    Returns

loc:int if unique index, slice if monotonic index, else mask

   Examples
>>> unique_index = pd.Index(list('abc'))
>>> unique_index.get_loc('b')
1

>>> monotonic_index = pd.Index(list('abbc'))
>>> monotonic_index.get_loc('b')
slice(1, 3, None)

>>> non_monotonic_index = pd.Index(list('abcb'))
>>> non_monotonic_index.get_loc('b')
array([False,  True, False,  True])


pandas.Index.get_slice_bound   Index.get_slice_bound(label, side, kind=NoDefault.no_default)[source]

Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if side=='right') position of given label.  Parameters

label:object

side:{‘left’, ‘right’}

kind:{‘loc’, ‘getitem’} or None

 Deprecated since version 1.4.0.     Returns
 int

Index of label.


pandas.Index.get_value   finalIndex.get_value(series, key)[source]

Fast lookup of value from 1-dimensional ndarray. Only use this if you know what you’re doing.  Returns
 scalar or Series


pandas.Index.groupby   finalIndex.groupby(values)[source]

Group the index labels by a given array of values.  Parameters

values:array

Values used to determine the groups.    Returns
 dict

{group name -> group labels}


pandas.Index.has_duplicates   propertyIndex.has_duplicates

Check if the Index has duplicate values.  Returns
 bool

Whether or not the Index has duplicate values.     Examples
>>> idx = pd.Index([1, 5, 7, 7])
>>> idx.has_duplicates
True

>>> idx = pd.Index([1, 5, 7])
>>> idx.has_duplicates
False

>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.has_duplicates
True

>>> idx = pd.Index(["Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.has_duplicates
False


pandas.Index.hasnans   Index.hasnans

Return True if there are any NaNs. Enables various performance speedups.


pandas.Index.holds_integer   finalIndex.holds_integer()[source]

Whether the type is an integer type.


pandas.Index.identical   finalIndex.identical(other)[source]

Similar to equals, but checks that object attributes and types are also equal.  Returns
 bool

If two Index objects have equal elements and same type True, otherwise False.


pandas.Index.inferred_type   Index.inferred_type

Return a string of the type inferred from the values.


pandas.Index.insert   Index.insert(loc, item)[source]

Make new Index inserting new item at location. Follows Python numpy.insert semantics for negative values.  Parameters

loc:int

item:object

  Returns

new_index:Index


pandas.Index.intersection   finalIndex.intersection(other, sort=False)[source]

Form the intersection of two Index objects. This returns a new Index with elements common to the index and other.  Parameters

other:Index or array-like

sort:False or None, default False

Whether to sort the resulting index.  False : do not sort the result. None : sort the result, except when self and other are equal or when the values cannot be compared.     Returns

intersection:Index

   Examples
>>> idx1 = pd.Index([1, 2, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Int64Index([3, 4], dtype='int64')


pandas.Index.is_   finalIndex.is_(other)[source]

More flexible, faster check like is but that works through views. Note: this is not the same as Index.identical(), which checks that metadata is also the same.  Parameters

other:object

Other object to compare against.    Returns
 bool

True if both have same underlying data, False otherwise.      See also  Index.identical

Works like Index.is_ but also checks metadata.


pandas.Index.is_all_dates   Index.is_all_dates

Whether or not the index values only consist of dates.


pandas.Index.is_boolean   finalIndex.is_boolean()[source]

Check if the Index only consists of booleans.  Returns
 bool

Whether or not the Index only consists of booleans.      See also  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index([True, False, True])
>>> idx.is_boolean()
True

>>> idx = pd.Index(["True", "False", "True"])
>>> idx.is_boolean()
False

>>> idx = pd.Index([True, False, "True"])
>>> idx.is_boolean()
False


pandas.Index.is_categorical   finalIndex.is_categorical()[source]

Check if the Index holds categorical data.  Returns
 bool

True if the Index is categorical.      See also  CategoricalIndex

Index for categorical data.  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.is_categorical()
True

>>> idx = pd.Index([1, 3, 5, 7])
>>> idx.is_categorical()
False

>>> s = pd.Series(["Peter", "Victor", "Elisabeth", "Mar"])
>>> s
0        Peter
1       Victor
2    Elisabeth
3          Mar
dtype: object
>>> s.index.is_categorical()
False


pandas.Index.is_floating   finalIndex.is_floating()[source]

Check if the Index is a floating type. The Index may consist of only floats, NaNs, or a mix of floats, integers, or NaNs.  Returns
 bool

Whether or not the Index only consists of only consists of floats, NaNs, or a mix of floats, integers, or NaNs.      See also  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
>>> idx.is_floating()
True

>>> idx = pd.Index([1.0, 2.0, np.nan, 4.0])
>>> idx.is_floating()
True

>>> idx = pd.Index([1, 2, 3, 4, np.nan])
>>> idx.is_floating()
True

>>> idx = pd.Index([1, 2, 3, 4])
>>> idx.is_floating()
False


pandas.Index.is_integer   finalIndex.is_integer()[source]

Check if the Index only consists of integers.  Returns
 bool

Whether or not the Index only consists of integers.      See also  is_boolean

Check if the Index only consists of booleans.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index([1, 2, 3, 4])
>>> idx.is_integer()
True

>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
>>> idx.is_integer()
False

>>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
>>> idx.is_integer()
False


pandas.Index.is_interval   finalIndex.is_interval()[source]

Check if the Index holds Interval objects.  Returns
 bool

Whether or not the Index holds Interval objects.      See also  IntervalIndex

Index for Interval objects.  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index([pd.Interval(left=0, right=5),
...                 pd.Interval(left=5, right=10)])
>>> idx.is_interval()
True

>>> idx = pd.Index([1, 3, 5, 7])
>>> idx.is_interval()
False


pandas.Index.is_mixed   finalIndex.is_mixed()[source]

Check if the Index holds data with mixed data types.  Returns
 bool

Whether or not the Index holds data with mixed data types.      See also  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.    Examples
>>> idx = pd.Index(['a', np.nan, 'b'])
>>> idx.is_mixed()
True

>>> idx = pd.Index([1.0, 2.0, 3.0, 5.0])
>>> idx.is_mixed()
False


pandas.Index.is_monotonic   propertyIndex.is_monotonic

Alias for is_monotonic_increasing.


pandas.Index.is_monotonic_decreasing   propertyIndex.is_monotonic_decreasing

Return if the index is monotonic decreasing (only equal or decreasing) values. Examples
>>> Index([3, 2, 1]).is_monotonic_decreasing
True
>>> Index([3, 2, 2]).is_monotonic_decreasing
True
>>> Index([3, 1, 2]).is_monotonic_decreasing
False


pandas.Index.is_monotonic_increasing   propertyIndex.is_monotonic_increasing

Return if the index is monotonic increasing (only equal or increasing) values. Examples
>>> Index([1, 2, 3]).is_monotonic_increasing
True
>>> Index([1, 2, 2]).is_monotonic_increasing
True
>>> Index([1, 3, 2]).is_monotonic_increasing
False


pandas.Index.is_numeric   finalIndex.is_numeric()[source]

Check if the Index only consists of numeric data.  Returns
 bool

Whether or not the Index only consists of numeric data.      See also  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
>>> idx.is_numeric()
True

>>> idx = pd.Index([1, 2, 3, 4.0])
>>> idx.is_numeric()
True

>>> idx = pd.Index([1, 2, 3, 4])
>>> idx.is_numeric()
True

>>> idx = pd.Index([1, 2, 3, 4.0, np.nan])
>>> idx.is_numeric()
True

>>> idx = pd.Index([1, 2, 3, 4.0, np.nan, "Apple"])
>>> idx.is_numeric()
False


pandas.Index.is_object   finalIndex.is_object()[source]

Check if the Index is of the object dtype.  Returns
 bool

Whether or not the Index is of the object dtype.      See also  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples
>>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
>>> idx.is_object()
True

>>> idx = pd.Index(["Apple", "Mango", 2.0])
>>> idx.is_object()
True

>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.is_object()
False

>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
>>> idx.is_object()
False


pandas.Index.is_type_compatible   Index.is_type_compatible(kind)[source]

Whether the index type is compatible with the provided type.


pandas.Index.is_unique   Index.is_unique

Return if the index has unique values.


pandas.Index.isin   Index.isin(values, level=None)[source]

Return a boolean array where the index values are in values. Compute boolean array of whether each index value is found in the passed set of values. The length of the returned boolean array matches the length of the index.  Parameters

values:set or list-like

Sought values.
level:str or int, optional

Name or position of the index level to use (if the index is a MultiIndex).    Returns
 np.ndarray[bool]

NumPy array of boolean values.      See also  Series.isin

Same for Series.  DataFrame.isin

Same method for DataFrames.    Notes In the case of MultiIndex you must either specify values as a list-like object containing tuples that are the same length as the number of levels, or specify level. Otherwise it will raise a ValueError. If level is specified:  if it is the name of one and only one index level, use that level; otherwise it should be a number indicating level position.  Examples
>>> idx = pd.Index([1,2,3])
>>> idx
Int64Index([1, 2, 3], dtype='int64')
  Check whether each index value in a list of values.
>>> idx.isin([1, 4])
array([ True, False, False])

>>> midx = pd.MultiIndex.from_arrays([[1,2,3],
...                                  ['red', 'blue', 'green']],
...                                  names=('number', 'color'))
>>> midx
MultiIndex([(1,   'red'),
            (2,  'blue'),
            (3, 'green')],
           names=['number', 'color'])
  Check whether the strings in the ‘color’ level of the MultiIndex are in a list of colors.
>>> midx.isin(['red', 'orange', 'yellow'], level='color')
array([ True, False, False])
  To check across the levels of a MultiIndex, pass a list of tuples:
>>> midx.isin([(1, 'red'), (3, 'red')])
array([ True, False, False])
  For a DatetimeIndex, string values in values are converted to Timestamps.
>>> dates = ['2000-03-11', '2000-03-12', '2000-03-13']
>>> dti = pd.to_datetime(dates)
>>> dti
DatetimeIndex(['2000-03-11', '2000-03-12', '2000-03-13'],
dtype='datetime64[ns]', freq=None)

>>> dti.isin(['2000-03-11'])
array([ True, False, False])


pandas.Index.isna   finalIndex.isna()[source]

Detect missing values. Return a boolean same-sized object indicating if the values are NA. NA values, such as None, numpy.NaN or pd.NaT, get mapped to True values. Everything else get mapped to False values. Characters such as empty strings ‘’ or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True).  Returns
 numpy.ndarray[bool]

A boolean array of whether my values are NA.      See also  Index.notna

Boolean inverse of isna.  Index.dropna

Omit entries with missing values.  isna

Top-level isna.  Series.isna

Detect missing values in Series object.    Examples Show which entries in a pandas.Index are NA. The result is an array.
>>> idx = pd.Index([5.2, 6.0, np.NaN])
>>> idx
Float64Index([5.2, 6.0, nan], dtype='float64')
>>> idx.isna()
array([False, False,  True])
  Empty strings are not considered NA values. None is considered an NA value.
>>> idx = pd.Index(['black', '', 'red', None])
>>> idx
Index(['black', '', 'red', None], dtype='object')
>>> idx.isna()
array([False, False, False,  True])
  For datetimes, NaT (Not a Time) is considered as an NA value.
>>> idx = pd.DatetimeIndex([pd.Timestamp('1940-04-25'),
...                         pd.Timestamp(''), None, pd.NaT])
>>> idx
DatetimeIndex(['1940-04-25', 'NaT', 'NaT', 'NaT'],
              dtype='datetime64[ns]', freq=None)
>>> idx.isna()
array([False,  True,  True,  True])


pandas.Index.isnull   Index.isnull()[source]

Detect missing values. Return a boolean same-sized object indicating if the values are NA. NA values, such as None, numpy.NaN or pd.NaT, get mapped to True values. Everything else get mapped to False values. Characters such as empty strings ‘’ or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True).  Returns
 numpy.ndarray[bool]

A boolean array of whether my values are NA.      See also  Index.notna

Boolean inverse of isna.  Index.dropna

Omit entries with missing values.  isna

Top-level isna.  Series.isna

Detect missing values in Series object.    Examples Show which entries in a pandas.Index are NA. The result is an array.
>>> idx = pd.Index([5.2, 6.0, np.NaN])
>>> idx
Float64Index([5.2, 6.0, nan], dtype='float64')
>>> idx.isna()
array([False, False,  True])
  Empty strings are not considered NA values. None is considered an NA value.
>>> idx = pd.Index(['black', '', 'red', None])
>>> idx
Index(['black', '', 'red', None], dtype='object')
>>> idx.isna()
array([False, False, False,  True])
  For datetimes, NaT (Not a Time) is considered as an NA value.
>>> idx = pd.DatetimeIndex([pd.Timestamp('1940-04-25'),
...                         pd.Timestamp(''), None, pd.NaT])
>>> idx
DatetimeIndex(['1940-04-25', 'NaT', 'NaT', 'NaT'],
              dtype='datetime64[ns]', freq=None)
>>> idx.isna()
array([False,  True,  True,  True])


pandas.Index.item   Index.item()[source]

Return the first element of the underlying data as a Python scalar.  Returns
 scalar

The first element of %(klass)s.    Raises
 ValueError

If the data is not length-1.


pandas.Index.join   finalIndex.join(other, how='left', level=None, return_indexers=False, sort=False)[source]

Compute join_index and indexers to conform data structures to the new index.  Parameters

other:Index

how:{‘left’, ‘right’, ‘inner’, ‘outer’}

level:int or level name, default None

return_indexers:bool, default False

sort:bool, default False

Sort the join keys lexicographically in the result Index. If False, the order of the join keys depends on the join type (how keyword).    Returns
 join_index, (left_indexer, right_indexer)


pandas.Index.map   Index.map(mapper, na_action=None)[source]

Map values using an input mapping or function.  Parameters

mapper:function, dict, or Series

Mapping correspondence.
na_action:{None, ‘ignore’}

If ‘ignore’, propagate NA values, without passing them to the mapping correspondence.    Returns

applied:Union[Index, MultiIndex], inferred

The output of the mapping function applied to the index. If the function returns a tuple with more than one element a MultiIndex will be returned.