English

Write a Python code to create a DataFrame with appropriate column headings from the list given below: [[101,'Gurman',98], [102,'Rajveer',95], [103,'samar' ,96], [104,'Yuvraj',88]] - Informatics Practices

Advertisements
Advertisements

Question

Write a Python code to create a DataFrame with appropriate column headings from the list given below:

[[101,'Gurman',98], [102,'Rajveer',95], [103,'Samar' ,96], [104,'Yuvraj',88]]

Short Note

Solution

import pandas as pd
data = [[101,'Gurman',98], [102,'Rajveer',95], [103,'Samar' ,96], [104,'Yuvraj',88]]
df = pd.DataFrame(data, columns = ['Rno','Name', 'Marks'])

shaalaa.com
Introduction to Python Libraries
  Is there an error in this question or solution?
2022-2023 (March) Sample
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×