In Pandas, the DataFrame.values
attribute is used to return the NumPy representation of a given dataframe.
DataFrame.values
This attribute takes no parameter value.
This attribute returns the values of a given dataframe.
import pandas as pd# creating a dataframedf = pd.DataFrame({'AGE': [ 20, 29],'HEIGHT': [94, 170],'WEIGHT': [80, 115]})# implementing the dataframe.values() functionprint(df.values)
pandas
module.df
.DataFrame.values
attribute to obtain the NumPy values of df
. Next, we print the value to the console.