data frame CREATION
data frame CREATION
import pandas as pd
DF = pd.DataFrame( )
print(DF)
OUTPUT:
Empty DataFrame
Columns: [ ]
Index: [ ]
OUTPUT:
0
0 11
1 22
2 33
3 44
4 55
OUTPUT:
C1
R1 11
R2 22
R3 33
R4 44
R5 55
OUTPUT:
0 1 2
0 21 X A
1 32 IX B
2 23 X A
3 12 XI A
OUTPUT:
OUTPUT:
OUTPUT:
import pandas as pd
df = pd.DataFrame([{'Ram' : 25, 'Anil' : 29, 'Simple' : 28},
{'Ram' : 21, 'Anil' : 25, 'Simple':23}, {'Ram' : 23, 'Anil' : 18,
'Simple' : 26}], index=['Term1', 'Term2', 'Term3'])
print(df)
OUTPUT:
Ram Anil Simple
Term1 25 29 28
Term2 21 25 23
Term3 23 18 26
OUTPUT:
OUTPUT:
0
0 10
1 20
2 30
3 40
OUTPUT:
0 1 2 3
R1 10 20 30 40
R2 11 22 33 44
R3 34 44 54 24
To create a DataFrame using more than one series, we need to
pass multiple series in the list as shown above
Attributes of DataFrames
Like Series, we can access certain properties called attributes
of a DataFrame. Some Attributes of Pandas DataFrame are
OUTPUT:
DATAFRAME
R1 R2 R3 R4
Ram 25 21 23 20
Anil 29 25 18 18
Simple 28 23 26 30
Anuj 17 20 23 15
VALUES
[[25 29 28 17]
[21 25 23 20]
[23 18 26 23]
[20 18 30 15]]
EMPTY
False