DataFrame values attribute return the Numpy representation of the DataFrame.
dataframe_values.py
import pandas as pd
# Create a sample DataFrame
data = {'Name': ['Krishna', 'Ram', 'Joel', 'Gopi', 'Jitendra', "Raj"],
'Age': [34, 25, 29, 41, 52, 23],
'City': ['Bangalore', 'Chennai', 'Hyderabad', 'Hyderabad', 'Bangalore', 'Chennai']}
df = pd.DataFrame(data)
print(df.values)
Output
[['Krishna' 34 'Bangalore'] ['Ram' 25 'Chennai'] ['Joel' 29 'Hyderabad'] ['Gopi' 41 'Hyderabad'] ['Jitendra' 52 'Bangalore'] ['Raj' 23 'Chennai']]
No comments:
Post a Comment