mteb/BrightProStackoverflowRetrieval huggingface dataset:
dex.from_fields ](pandas.PeriodIndex.from_fields.html)
    * [ pandas.PeriodIndex.from_ordinals ](pandas.PeriodIndex.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.MultiIndex ](pandas.MultiIndex.html)
  * pandas.Multi... 

#  pandas.MultiIndex.get_locs  #

MultiIndex.  get_locs  (  _ seq  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/multi.py#L3421-L3552) #

    

Get location for a sequence of labels.

Parameters  :

    

**seq** label, slice, list, mask or a sequence of such

    

You should use one of the above for each level. If a level should not be used,
set it to ` slice(None)  ` .

Returns  :

    

numpy.ndarray

    

NumPy array of integers suitable for passing to iloc.

See also

[ ` MultiIndex.get_loc  `
](pandas.MultiIndex.get_loc.html#pandas.MultiIndex.get_loc
"pandas.MultiIndex.get_loc")

    

Get location for a label or a tuple of labels.

` MultiIndex.slice_locs  `

    

Get slice location given start label(s) and end label(s).

Examples

    
    
    >>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
    
    
    
    >>> mi.get_locs('b')  
    array([1, 2], dtype=int64)
    
    
    
    >>> mi.get_locs([slice(None), ['e', 'f']])  
    array([1, 2], dtype=int64)
    
    
    
    >>> mi.get_locs([[True, False, True], slice('e', 'f')])  
    array([2], dtype=int64)
    

[ __ previous  pandas.MultiIndex.get_loc  ](pandas.MultiIndex.get_loc.html
"previous page") [ next  pandas.MultiIndex.get_loc_level  __
](pandas.MultiIndex.get_loc_level.html "next page")

__ On this page

  * ` MultiIndex.get_locs()  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.get_locs.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
pby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataF... 

#  pandas.DataFrame.mean  #

DataFrame.  mean  (  _ axis  =  0  _ , _ skipna  =  True  _ , _ numeric_only
=  False  _ , _ **  kwargs  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L11685-L11696) #

    

Return the mean of the values over the requested axis.

Parameters  :

    

**axis** {index (0), columns (1)}

    

Axis for the function to be applied on. For  Series  this parameter is unused
and defaults to 0.

For DataFrames, specifying ` axis=None  ` will apply the aggregation across
both axes.

New in version 2.0.0.

**skipna** bool, default True

    

Exclude NA/null values when computing the result.

**numeric_only** bool, default False

    

Include only float, int, boolean columns. Not implemented for Series.

****kwargs**

    

Additional keyword arguments to be passed to the function.

Returns  :

    

Series or scalar

    

Examples

    
    
    >>> s = pd.Series([1, 2, 3])
    >>> s.mean()
    2.0
    

With a DataFrame

    
    
    >>> df = pd.DataFrame({'a': [1, 2], 'b': [2, 3]}, index=['tiger', 'zebra'])
    >>> df
           a   b
    tiger  1   2
    zebra  2   3
    >>> df.mean()
    a   1.5
    b   2.5
    dtype: float64
    

Using axis=1

    
    
    >>> df.mean(axis=1)
    tiger   1.5
    zebra   2.5
    dtype: float64
    

In this case,  numeric_only  should be set to  True  to avoid getting an
error.

    
    
    >>> df = pd.DataFrame({'a': [1, 2], 'b': ['T', 'Z']},
    ...                   index=['tiger', 'zebra'])
    >>> df.mean(numeric_only=True)
    a   1.5
    dtype: float64
    

[ __ previous  pandas.DataFrame.max  ](pandas.DataFrame.max.html "previous
page") [ next  pandas.DataFrame.median  __ ](pandas.DataFrame.median.html
"next page")

__ On this page

  * ` DataFrame.mean()  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.mean.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
iodIndex.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.PeriodIndex ](pandas.PeriodIndex.html)
  * pandas.Perio... 

#  pandas.PeriodIndex.day  #

_ property  _ PeriodIndex.  day  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/extension.py#L67-L75) #

    

The days of the period.

Examples

    
    
    >>> idx = pd.PeriodIndex(['2020-01-31', '2020-02-28'], freq='D')
    >>> idx.day
    Index([31, 28], dtype='int64')
    

[ __ previous  pandas.PeriodIndex  ](pandas.PeriodIndex.html "previous page")
[ next  pandas.PeriodIndex.dayofweek  __ ](pandas.PeriodIndex.dayofweek.html
"next page")

__ On this page

  * ` PeriodIndex.day  `

[ __ Show Source
](../../_sources/reference/api/pandas.PeriodIndex.day.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
ml)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataF... 

#  pandas.DataFrame.tz_convert  #

DataFrame.  tz_convert  (  _ tz  _ , _ axis  =  0  _ , _ level  =  None  _ , _
copy  =  None  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/generic.py#L11444-L11535) #

    

Convert tz-aware axis to target time zone.

Parameters  :

    

**tz** str or tzinfo object or None

    

Target time zone. Passing ` None  ` will convert to UTC and remove the
timezone information.

**axis** {0 or âindexâ, 1 or âcolumnsâ}, default 0

    

The axis to convert

**level** int, str, default None

    

If axis is a MultiIndex, convert a specific level. Otherwise must be None.

**copy** bool, default True

    

Also make a copy of the underlying data.

Note

The  copy  keyword will change behavior in pandas 3.0. [ Copy-on-Write
](https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html) will be
enabled by default, which means that all methods with a  copy  keyword will
use a lazy copy mechanism to defer the copy and ignore the  copy  keyword. The
copy  keyword will be removed in a future version of pandas.

You can already get the future behavior and improvements through enabling copy
on write ` pd.options.mode.copy_on_write  =  True  `

Returns  :

    

Series/DataFrame

    

Object with time zone converted axis.

Raises  :

    

TypeError

    

If the axis is tz-naive.

Examples

Change to another time zone:

    
    
    >>> s = pd.Series(
    ...     [1],
    ...     index=pd.DatetimeIndex(['2018-09-15 01:30:00+02:00']),
    ... )
    >>> s.tz_convert('Asia/Shanghai')
    2018-09-15 07:30:00+08:00    1
    dtype: int64
    

Pass None to convert to UTC and get a tz-naive index:

    
    
    >>> s = pd.Series([1],
    ...               index=pd.DatetimeIndex(['2018-09-15 01:30:00+02:00']))
    >>> s.tz_convert(None)
    2018-09-14 23:30:00    1
    dtype: int64
    

[ __ previous  pandas.DataFrame.to_timestamp
](pandas.DataFrame.to_timestamp.html "previous page") [ next
pandas.DataFrame.tz_localize  __ ](pandas.DataFrame.tz_localize.html "next
page")

__ On this page

  * ` DataFrame.tz_convert()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.tz_convert.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
dinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.PeriodIndex ](pandas.PeriodIndex.html)
  * pandas.Perio... 

#  pandas.PeriodIndex.daysinmonth  #

_ property  _ PeriodIndex.  daysinmonth  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/extension.py#L67-L75) #

    

The number of days in the month.

Examples

For Series:

    
    
    >>> period = pd.period_range('2020-1-1 00:00', '2020-3-1 00:00', freq='M')
    >>> s = pd.Series(period)
    >>> s
    0   2020-01
    1   2020-02
    2   2020-03
    dtype: period[M]
    >>> s.dt.days_in_month
    0    31
    1    29
    2    31
    dtype: int64
    

For PeriodIndex:

    
    
    >>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
    >>> idx.days_in_month   # It can be also entered as `daysinmonth`
    Index([31, 28, 31], dtype='int64')
    

[ __ previous  pandas.PeriodIndex.days_in_month
](pandas.PeriodIndex.days_in_month.html "previous page") [ next
pandas.PeriodIndex.end_time  __ ](pandas.PeriodIndex.end_time.html "next
page")

__ On this page

  * ` PeriodIndex.daysinmonth  `

[ __ Show Source
](../../_sources/reference/api/pandas.PeriodIndex.daysinmonth.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
by.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataF... 

#  pandas.DataFrame.notna  #

DataFrame.  notna  (  )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L6501-L6503) #

    

Detect existing (non-missing) values.

Return a boolean same-sized object indicating if the values are not NA. Non-
missing values get mapped to True. Characters such as empty strings ` ''  ` or
` numpy.inf  ` are not considered NA values (unless you set `
pandas.options.mode.use_inf_as_na  =  True  ` ). NA values, such as None or `
numpy.NaN  ` , get mapped to False values.

Returns  :

    

DataFrame

    

Mask of bool values for each element in DataFrame that indicates whether an
element is not an NA value.

See also

[ ` DataFrame.notnull  `
](pandas.DataFrame.notnull.html#pandas.DataFrame.notnull
"pandas.DataFrame.notnull")

    

Alias of notna.

[ ` DataFrame.isna  ` ](pandas.DataFrame.isna.html#pandas.DataFrame.isna
"pandas.DataFrame.isna")

    

Boolean inverse of notna.

[ ` DataFrame.dropna  ` ](pandas.DataFrame.dropna.html#pandas.DataFrame.dropna
"pandas.DataFrame.dropna")

    

Omit axes labels with missing values.

[ ` notna  ` ](pandas.notna.html#pandas.notna "pandas.notna")

    

Top-level notna.

Examples

Show which entries in a DataFrame are not NA.

    
    
    >>> df = pd.DataFrame(dict(age=[5, 6, np.nan],
    ...                        born=[pd.NaT, pd.Timestamp('1939-05-27'),
    ...                              pd.Timestamp('1940-04-25')],
    ...                        name=['Alfred', 'Batman', ''],
    ...                        toy=[None, 'Batmobile', 'Joker']))
    >>> df
       age       born    name        toy
    0  5.0        NaT  Alfred       None
    1  6.0 1939-05-27  Batman  Batmobile
    2  NaN 1940-04-25              Joker
    
    
    
    >>> df.notna()
         age   born  name    toy
    0   True  False  True  False
    1   True   True  True   True
    2  False   True  True   True
    

Show which entries in a Series are not NA.

    
    
    >>> ser = pd.Series([5, 6, np.nan])
    >>> ser
    0    5.0
    1    6.0
    2    NaN
    dtype: float64
    
    
    
    >>> ser.notna()
    0     True
    1     True
    2    False
    dtype: bool
    

[ __ previous  pandas.DataFrame.isnull  ](pandas.DataFrame.isnull.html
"previous page") [ next  pandas.DataFrame.notnull  __
](pandas.DataFrame.notnull.html "next page")

__ On this page

  * ` DataFrame.notna()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.notna.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.PeriodIndex ](pandas.PeriodIndex.html)
  * pandas.Perio... 

#  pandas.PeriodIndex.weekday  #

_ property  _ PeriodIndex.  weekday  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/extension.py#L67-L75) #

    

The day of the week with Monday=0, Sunday=6.

Examples

    
    
    >>> idx = pd.PeriodIndex(["2023-01-01", "2023-01-02", "2023-01-03"], freq="D")
    >>> idx.weekday
    Index([6, 0, 1], dtype='int64')
    

[ __ previous  pandas.PeriodIndex.week  ](pandas.PeriodIndex.week.html
"previous page") [ next  pandas.PeriodIndex.weekofyear  __
](pandas.PeriodIndex.weekofyear.html "next page")

__ On this page

  * ` PeriodIndex.weekday  `

[ __ Show Source
](../../_sources/reference/api/pandas.PeriodIndex.weekday.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
upby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataFrame.sem 

#  pandas.DataFrame.sem  #

DataFrame.  sem  (  _ axis  =  0  _ , _ skipna  =  True  _ , _ ddof  =  1  _ ,
_ numeric_only  =  False  _ , _ **  kwargs  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L11711-L11723) #

    

Return unbiased standard error of the mean over requested axis.

Normalized by N-1 by default. This can be changed using the ddof argument

Parameters  :

    

**axis** {index (0), columns (1)}

    

For  Series  this parameter is unused and defaults to 0.

Warning

The behavior of DataFrame.sem with ` axis=None  ` is deprecated, in a future
version this will reduce over both axes and return a scalar To retain the old
behavior, pass axis=0 (or do not pass axis).

**skipna** bool, default True

    

Exclude NA/null values. If an entire row/column is NA, the result will be NA.

**ddof** int, default 1

    

Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where
N represents the number of elements.

**numeric_only** bool, default False

    

Include only float, int, boolean columns. Not implemented for Series.

Returns  :

    

Series or DataFrame (if level specified)

    

Examples

    
    
    >>> s = pd.Series([1, 2, 3])
    >>> s.sem().round(6)
    0.57735
    

With a DataFrame

    
    
    >>> df = pd.DataFrame({'a': [1, 2], 'b': [2, 3]}, index=['tiger', 'zebra'])
    >>> df
           a   b
    tiger  1   2
    zebra  2   3
    >>> df.sem()
    a   0.5
    b   0.5
    dtype: float64
    

Using axis=1

    
    
    >>> df.sem(axis=1)
    tiger   0.5
    zebra   0.5
    dtype: float64
    

In this case,  numeric_only  should be set to  True  to avoid getting an
error.

    
    
    >>> df = pd.DataFrame({'a': [1, 2], 'b': ['T', 'Z']},
    ...                   index=['tiger', 'zebra'])
    >>> df.sem(numeric_only=True)
    a   0.5
    dtype: float64
    

[ __ previous  pandas.DataFrame.round  ](pandas.DataFrame.round.html "previous
page") [ next  pandas.DataFrame.skew  __ ](pandas.DataFrame.skew.html "next
page")

__ On this page

  * ` DataFrame.sem()  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.sem.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
x.from_fields ](pandas.PeriodIndex.from_fields.html)
    * [ pandas.PeriodIndex.from_ordinals ](pandas.PeriodIndex.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.MultiIndex ](pandas.MultiIndex.html)
  * pandas.Multi... 

#  pandas.MultiIndex.sortlevel  #

MultiIndex.  sortlevel  (  _ level  =  0  _ , _ ascending  =  True  _ , _
sort_remaining  =  True  _ , _ na_position  =  'first'  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/multi.py#L2608-L2707) #

    

Sort MultiIndex at the requested level.

The result will respect the original ordering of the associated factor at that
level.

Parameters  :

    

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

    

If a string is given, must be a name of the level. If list-like must be names
or ints of levels.

**ascending** bool, default True

    

False to sort in descending order. Can also be a list to specify a directed
ordering.

**sort_remaining** sort by the remaining levels after level

    
**na_position** {âfirstâ or âlastâ}, default âfirstâ

    

Argument âfirstâ puts NaNs at the beginning, âlastâ puts NaNs at the
end.

New in version 2.1.0.

Returns  :

    

**sorted_index** pd.MultiIndex

    

Resulting index.

**indexer** np.ndarray[np.intp]

    

Indices of output values in original index.

Examples

    
    
    >>> mi = pd.MultiIndex.from_arrays([[0, 0], [2, 1]])
    >>> mi
    MultiIndex([(0, 2),
                (0, 1)],
               )
    
    
    
    >>> mi.sortlevel()
    (MultiIndex([(0, 1),
                (0, 2)],
               ), array([1, 0]))
    
    
    
    >>> mi.sortlevel(sort_remaining=False)
    (MultiIndex([(0, 2),
                (0, 1)],
               ), array([0, 1]))
    
    
    
    >>> mi.sortlevel(1)
    (MultiIndex([(0, 1),
                (0, 2)],
               ), array([1, 0]))
    
    
    
    >>> mi.sortlevel(1, ascending=False)
    (MultiIndex([(0, 2),
                (0, 1)],
               ), array([0, 1]))
    

[ __ previous  pandas.MultiIndex.to_flat_index
](pandas.MultiIndex.to_flat_index.html "previous page") [ next
pandas.MultiIndex.droplevel  __ ](pandas.MultiIndex.droplevel.html "next
page")

__ On this page

  * ` MultiIndex.sortlevel()  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.sortlevel.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.
riodIndex.from_fields ](pandas.PeriodIndex.from_fields.html)
    * [ pandas.PeriodIndex.from_ordinals ](pandas.PeriodIndex.from_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.MultiIndex ](pandas.MultiIndex.html)
  * pandas.Multi... 

#  pandas.MultiIndex.names  #

_ property  _ MultiIndex.  names  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/multi.py#L1571-L1572) #

    

Names of levels in 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.names
    FrozenList(['x', 'y', 'z'])
    

[ __ previous  pandas.MultiIndex  ](pandas.MultiIndex.html "previous page") [
next  pandas.MultiIndex.levels  __ ](pandas.MultiIndex.levels.html "next
page")

__ On this page

  * ` MultiIndex.names  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.names.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.