Articles → Pandas → Dataframe In Pandas

Dataframe In Pandas






What Is Dataframe?




Picture showing the pictorical representation of the dataframe
Click to Enlarge


Example




import numpy as np
import pandas as pd

print(pd.DataFrame(np.random.randn(5,4),['A', 'B', 'C', 'D', 'E'],['W', 'X', 'Y', 'Z']))




Picture showing the output of the dataframe in pandas
Click to Enlarge


Access Elements In Dataframe




import numpy as np
import pandas as pd

df = pd.DataFrame(np.random.randn(5,4),['A', 'B', 'C', 'D', 'E'],['W', 'X', 'Y', 'Z'])

print(df['W'])

# You can also use df.W




Picture showing how the data is accessed column-wise in dataframe
Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Thursday, April 11, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250