DataFrames:
-It is a two dimensional data structure defined in pandas which consists of rows and columns.
Syntax-
pandas.DataFrame(data)
Here data can be :
1. one or more dictionary.
2. one or more series
3. 2D numpy Ndarray
import pandas
d={1:'a',2:'b',3:'c',4:'d'}
ans=pandas.DataFrame(d,index=[0,1,2,3])
print(ans)
1 2 3 4
0 a b c d
1 a b c d
2 a b c d
3 a b c d
import pandas
d={1:'a',2:'b'}
d={'first':d,'second':d}
ans=pandas.DataFrame(d)
print(ans)
first second
1 a a
2 b b