197k views
2 votes
Create the following dataframe Student from dictionary of series and display

the details of each student. (row wise).
Name Subject Marks
1 Anjan English 78
2 Shreya Science 87
3 Meena Science 81
4 Karan Maths 91

User Studentbi
by
5.7k points

1 Answer

4 votes

Answer:

import pandas as pd

pd.Dataframe(information)

Step-by-step explanation:

Given :

Name Subject Marks

1 Anjan English 78

2 Shreya Science 87

3 Meena Science 81

4 Karan Maths 91

information = { 'Name' : ['Anjan', 'Shreya', 'Meena', 'Karan'], 'Subject' : ['English', 'Science', 'Science', 'Maths'], 'Marks' : [ 78, 87, 81, 91]}

The information in the table can be embedded in dictionary list as given above.

Using the pandas library in python :

The Dataframe method in pandas will create the table as shown by putting the variable as an argument in the DataFrame method.

User Hugo Trentesaux
by
5.8k points