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.values  #

_ property  _ DataFrame.  values  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L12590-L12664) #

    

Return a Numpy representation of the DataFrame.

Warning

We recommend using [ ` DataFrame.to_numpy()  `
](pandas.DataFrame.to_numpy.html#pandas.DataFrame.to_numpy
"pandas.DataFrame.to_numpy") instead.

Only the values in the DataFrame will be returned, the axes labels will be
removed.

Returns  :

    

numpy.ndarray

    

The values of the DataFrame.

See also

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

    

Recommended alternative to this method.

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

    

Retrieve the index labels.

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

    

Retrieving the column names.

Notes

The dtype will be a lower-common-denominator dtype (implicit upcasting); that
is to say if the dtypes (even of numeric types) are mixed, the one that
accommodates all will be chosen. Use this with care if you are not dealing
with the blocks.

e.g. If the dtypes are float16 and float32, dtype will be upcast to float32.
If dtypes are int32 and uint8, dtype will be upcast to int32. By [ `
numpy.find_common_type()  `
](https://numpy.org/doc/stable/reference/generated/numpy.find_common_type.html#numpy.find_common_type
"\(in NumPy v1.26\)") convention, mixing int64 and uint64 will result in a
float64 dtype.

Examples

A DataFrame where all columns are the same type (e.g., int64) results in an
array of the same type.

    
    
    >>> df = pd.DataFrame({'age':    [ 3,  29],
    ...                    'height': [94, 170],
    ...                    'weight': [31, 115]})
    >>> df
       age  height  weight
    0    3      94      31
    1   29     170     115
    >>> df.dtypes
    age       int64
    height    int64
    weight    int64
    dtype: object
    >>> df.values
    array([[  3,  94,  31],
           [ 29, 170, 115]])
    

A DataFrame with mixed type columns(e.g., str/object, int64, float32) results
in an ndarray of the broadest type that accommodates these mixed types (e.g.,
object).

    
    
    >>> df2 = pd.DataFrame([('parrot',   24.0, 'second'),
    ...                     ('lion',     80.5, 1),
    ...                     ('monkey', np.nan, None)],
    ...                   columns=('name', 'max_speed', 'rank'))
    >>> df2.dtypes
    name          object
    max_speed    float64
    rank          object
    dtype: object
    >>> df2.values
    array([['parrot', 24.0, 'second'],
           ['lion', 80.5, 1],
           ['monkey', nan, None]], dtype=object)
    

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

__ On this page

  * ` DataFrame.values  `

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