mteb/BrightProStackoverflowRetrieval huggingface dataset:
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.ndim  #

_ property  _ DataFrame.  ndim  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/generic.py#L696-L718) #

    

Return an int representing the number of axes / array dimensions.

Return 1 if Series. Otherwise return 2 if DataFrame.

See also

` ndarray.ndim  `

    

Number of array dimensions.

Examples

    
    
    >>> s = pd.Series({'a': 1, 'b': 2, 'c': 3})
    >>> s.ndim
    1
    
    
    
    >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
    >>> df.ndim
    2
    

[ __ previous  pandas.DataFrame.axes  ](pandas.DataFrame.axes.html "previous
page") [ next  pandas.DataFrame.size  __ ](pandas.DataFrame.size.html "next
page")

__ On this page

  * ` DataFrame.ndim  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.ndim.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.freqstr  #

_ property  _ PeriodIndex.  freqstr  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/datetimelike.py#L112-L123) #

    

Return the frequency object as a string if itâs set, otherwise None.

Examples

For DatetimeIndex:

    
    
    >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00"], freq="D")
    >>> idx.freqstr
    'D'
    

The frequency can be inferred if there are more than 2 points:

    
    
    >>> idx = pd.DatetimeIndex(["2018-01-01", "2018-01-03", "2018-01-05"],
    ...                        freq="infer")
    >>> idx.freqstr
    '2D'
    

For PeriodIndex:

    
    
    >>> idx = pd.PeriodIndex(["2023-1", "2023-2", "2023-3"], freq="M")
    >>> idx.freqstr
    'M'
    

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

__ On this page

  * ` PeriodIndex.freqstr  `

[ __ Show Source
](../../_sources/reference/api/pandas.PeriodIndex.freqstr.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.swaplevel  #

MultiIndex.  swaplevel  (  _ i  =  -2  _ , _ j  =  -1  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/multi.py#L2467-L2523) #

    

Swap level i with level j.

Calling this method does not change the ordering of the values.

Parameters  :

    

**i** int, str, default -2

    

First level of index to be swapped. Can pass level name as string. Type of
parameters can be mixed.

**j** int, str, default -1

    

Second level of index to be swapped. Can pass level name as string. Type of
parameters can be mixed.

Returns  :

    

MultiIndex

    

A new MultiIndex.

See also

[ ` Series.swaplevel  ` ](pandas.Series.swaplevel.html#pandas.Series.swaplevel
"pandas.Series.swaplevel")

    

Swap levels i and j in a MultiIndex.

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

    

Swap levels i and j in a MultiIndex on a particular axis.

Examples

    
    
    >>> mi = pd.MultiIndex(levels=[['a', 'b'], ['bb', 'aa']],
    ...                    codes=[[0, 0, 1, 1], [0, 1, 0, 1]])
    >>> mi
    MultiIndex([('a', 'bb'),
                ('a', 'aa'),
                ('b', 'bb'),
                ('b', 'aa')],
               )
    >>> mi.swaplevel(0, 1)
    MultiIndex([('bb', 'a'),
                ('aa', 'a'),
                ('bb', 'b'),
                ('aa', 'b')],
               )
    

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

__ On this page

  * ` MultiIndex.swaplevel()  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.swaplevel.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.
lds ](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.reorder_levels  #

MultiIndex.  reorder_levels  (  _ order  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/multi.py#L2525-L2559) #

    

Rearrange levels using input order. May not drop or duplicate levels.

Parameters  :

    

**order** list of int or list of str

    

List representing new level order. Reference level by number (position) or by
key (label).

Returns  :

    

MultiIndex

    

Examples

    
    
    >>> mi = pd.MultiIndex.from_arrays([[1, 2], [3, 4]], names=['x', 'y'])
    >>> mi
    MultiIndex([(1, 3),
                (2, 4)],
               names=['x', 'y'])
    
    
    
    >>> mi.reorder_levels(order=[1, 0])
    MultiIndex([(3, 1),
                (4, 2)],
               names=['y', 'x'])
    
    
    
    >>> mi.reorder_levels(order=['y', 'x'])
    MultiIndex([(3, 1),
                (4, 2)],
               names=['y', 'x'])
    

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

__ On this page

  * ` MultiIndex.reorder_levels()  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.reorder_levels.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.
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.applymap  #

DataFrame.  applymap  (  _ func  _ , _ na_action  =  None  _ , _ **  kwargs  _
)  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L10470-L10522) #

    

Apply a function to a Dataframe elementwise.

Deprecated since version 2.1.0:  DataFrame.applymap has been deprecated. Use
DataFrame.map instead.

This method applies a function that accepts and returns a scalar to every
element of a DataFrame.

Parameters  :

    

**func** callable

    

Python function, returns a single value from a single value.

**na_action** {None, âignoreâ}, default None

    

If âignoreâ, propagate NaN values, without passing them to func.

****kwargs**

    

Additional keyword arguments to pass as keywords arguments to  func  .

Returns  :

    

DataFrame

    

Transformed DataFrame.

See also

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

    

Apply a function along input axis of DataFrame.

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

    

Apply a function along input axis of DataFrame.

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

    

Replace values given in  to_replace  with  value  .

Examples

    
    
    >>> df = pd.DataFrame([[1, 2.12], [3.356, 4.567]])
    >>> df
           0      1
    0  1.000  2.120
    1  3.356  4.567
    
    
    
    >>> df.map(lambda x: len(str(x)))
       0  1
    0  3  4
    1  5  5
    

[ __ previous  pandas.DataFrame.map  ](pandas.DataFrame.map.html "previous
page") [ next  pandas.DataFrame.pipe  __ ](pandas.DataFrame.pipe.html "next
page")

__ On this page

  * ` DataFrame.applymap()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.applymap.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.keys  #

DataFrame.  keys  (  )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/generic.py#L2035-L2058) #

    

Get the âinfo axisâ (see Indexing for more).

This is index for Series, columns for DataFrame.

Returns  :

    

Index

    

Info axis.

Examples

    
    
    >>> d = pd.DataFrame(data={'A': [1, 2, 3], 'B': [0, 4, 8]},
    ...                  index=['a', 'b', 'c'])
    >>> d
       A  B
    a  1  0
    b  2  4
    c  3  8
    >>> d.keys()
    Index(['A', 'B'], dtype='object')
    

[ __ previous  pandas.DataFrame.items  ](pandas.DataFrame.items.html "previous
page") [ next  pandas.DataFrame.iterrows  __ ](pandas.DataFrame.iterrows.html
"next page")

__ On this page

  * ` DataFrame.keys()  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.keys.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.
Index.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.nlevels  #

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

    

Integer number of levels in this MultiIndex.

Examples

    
    
    >>> mi = pd.MultiIndex.from_arrays([['a'], ['b'], ['c']])
    >>> mi
    MultiIndex([('a', 'b', 'c')],
               )
    >>> mi.nlevels
    3
    

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

__ On this page

  * ` MultiIndex.nlevels  `

[ __ Show Source
](../../_sources/reference/api/pandas.MultiIndex.nlevels.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.
* [ 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.__dataframe__  #

DataFrame.  __dataframe__  (  _ nan_as_null  =  False  _ , _ allow_copy  =
True  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L940-L984) #

    

Return the dataframe interchange object implementing the interchange protocol.

Parameters  :

    

**nan_as_null** bool, default False

    

nan_as_null  is DEPRECATED and has no effect. Please avoid using it; it will
be removed in a future release.

**allow_copy** bool, default True

    

Whether to allow memory copying when exporting. If set to False it would cause
non-zero-copy exports to fail.

Returns  :

    

DataFrame interchange object

    

The object which consuming library can use to ingress the dataframe.

Notes

Details on the interchange protocol: [ https://data-apis.org/dataframe-
protocol/latest/index.html ](https://data-apis.org/dataframe-
protocol/latest/index.html)

Examples

    
    
    >>> df_not_necessarily_pandas = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
    >>> interchange_object = df_not_necessarily_pandas.__dataframe__()
    >>> interchange_object.column_names()
    Index(['A', 'B'], dtype='object')
    >>> df_pandas = (pd.api.interchange.from_dataframe
    ...              (interchange_object.select_columns_by_name(['A'])))
    >>> df_pandas
         A
    0    1
    1    2
    

These methods ( ` column_names  ` , ` select_columns_by_name  ` ) should work
for any dataframe library which implements the interchange protocol.

[ __ previous  pandas.DataFrame.style  ](pandas.DataFrame.style.html "previous
page") [ next  pandas arrays, scalars, and data types  __ ](../arrays.html
"next page")

__ On this page

  * ` DataFrame.__dataframe__()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.__dataframe__.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.
y.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.idxmin  #

DataFrame.  idxmin  (  _ axis  =  0  _ , _ skipna  =  True  _ , _ numeric_only
=  False  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L11838-L11873) #

    

Return index of first occurrence of minimum over requested axis.

NA/null values are excluded.

Parameters  :

    

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

    

The axis to use. 0 or âindexâ for row-wise, 1 or âcolumnsâ for column-
wise.

**skipna** bool, default True

    

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

**numeric_only** bool, default False

    

Include only  float  ,  int  or  boolean  data.

New in version 1.5.0.

Returns  :

    

Series

    

Indexes of minima along the specified axis.

Raises  :

    

ValueError

    

  * If the row/column is empty 

See also

[ ` Series.idxmin  ` ](pandas.Series.idxmin.html#pandas.Series.idxmin
"pandas.Series.idxmin")

    

Return index of the minimum element.

Notes

This method is the DataFrame version of ` ndarray.argmin  ` .

Examples

Consider a dataset containing food consumption in Argentina.

    
    
    >>> df = pd.DataFrame({'consumption': [10.51, 103.11, 55.48],
    ...                     'co2_emissions': [37.2, 19.66, 1712]},
    ...                   index=['Pork', 'Wheat Products', 'Beef'])
    
    
    
    >>> df
                    consumption  co2_emissions
    Pork                  10.51         37.20
    Wheat Products       103.11         19.66
    Beef                  55.48       1712.00
    

By default, it returns the index for the minimum value in each column.

    
    
    >>> df.idxmin()
    consumption                Pork
    co2_emissions    Wheat Products
    dtype: object
    

To return the index for the minimum value in each row, use ` axis="columns"  `
.

    
    
    >>> df.idxmin(axis="columns")
    Pork                consumption
    Wheat Products    co2_emissions
    Beef                consumption
    dtype: object
    

[ __ previous  pandas.DataFrame.idxmax  ](pandas.DataFrame.idxmax.html
"previous page") [ next  pandas.DataFrame.last  __
](pandas.DataFrame.last.html "next page")

__ On this page

  * ` DataFrame.idxmin()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.idxmin.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.skew  #

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

    

Return unbiased skew over requested axis.

Normalized by N-1.

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.skew()
    0.0
    

With a DataFrame

    
    
    >>> df = pd.DataFrame({'a': [1, 2, 3], 'b': [2, 3, 4], 'c': [1, 3, 5]},
    ...                   index=['tiger', 'zebra', 'cow'])
    >>> df
            a   b   c
    tiger   1   2   1
    zebra   2   3   3
    cow     3   4   5
    >>> df.skew()
    a   0.0
    b   0.0
    c   0.0
    dtype: float64
    

Using axis=1

    
    
    >>> df.skew(axis=1)
    tiger   1.732051
    zebra  -1.732051
    cow     0.000000
    dtype: float64
    

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

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

[ __ previous  pandas.DataFrame.sem  ](pandas.DataFrame.sem.html "previous
page") [ next  pandas.DataFrame.sum  __ ](pandas.DataFrame.sum.html "next
page")

__ On this page

  * ` DataFrame.skew()  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.skew.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.