Examples
A DataFrame where all columns are the same type (e.g., int64) results in an array of the same type.
import numpy as np
import pandas as pd
df = pd.DataFrame({'age': [ 5, 30],
'height': [84, 180],
'weight': [36, 95]})
df
df.values
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([('sparrow', 30.0, 'second'),
('tiger', 90.5, 1),
('fox', np.nan, None)],
columns=('name', 'max_speed', 'rank'))
df2.values