Creating DataFrame 2024
Creating DataFrame 2024
0 Laptop 60000
1 Desktop 45000
2 Monitor 1500
3 Tablet 3000
7. Consider the DataFrame MyDF given as below and create a DataFrame using list of dictionaries:
0 Emp_id Name Designation City Salary
1 E001 Ritvi Clerk Gurugram 32000
2 E025 Riya Programmer Delhi 65000
3 E034 Gaurav Data Analyst Bangalore 95000
4 E016 Kanishka Manager Mumbai 87000
8. Kabir, a data analyst, has stored the voter’s name and age in a dictionary. Now, Kabir wants to create a list of
dictionaries to store data of multiple voters. He also wants to create a DataFrame from the same list of
dictionaries having appropriate row label as shown below:
Voter_Name Voter_Age
Ar1001 Arjun 35
Ba3002 Bala 23
Go4002 Govind 25
Dh4007 Dhruv 19
Na6005 Navya 18
9. Write Python code to create a dataframe df (runs scored by batsman in last three years ) with appropriate row
labels from the dictionary given below :
{‘Virat’:[1000,962,1035],’Rohit’:[635,580,602],’Surya’:[1200,1008,1258]}