CBSE Class 12 Informatics Practices
Question 36 of 44
Data Handling using Pandas — Question 37
Back to all questions(a)
import pandas as pd
data = [[10, 11, 12, 13, 14],
[23, 34, 45, 32, 65],
[55, 60, 65, 70, 75]]
df = pd.DataFrame(data)
print(df) 0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
(b)
df.loc[3] = [12, 62, 53, 34, 75]
print(df) 0 1 2 3 4
0 10 11 12 13 14
1 23 34 45 32 65
2 55 60 65 70 75
3 12 62 53 34 75