Google News
logo
Pandas - Interview Questions
What is Pandas DataFrames?
DataFrame is a two-dimensional labeled data structure with columns of potentially different types. You can think of it like a spreadsheet or a dict of Series objects.
 
Creating DataFrame from a dictionary :

Syntax : 

import pandas as pd
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)

print(df)

 

Output :

   col1  col2

0     1     3

1     2     4

Advertisement