Informatics Practices
Write a program to create a Dataframe storing salesmen details (name, zone, sales) of five salesmen.
Python Pandas
4 Likes
Answer
import pandas as pd
salesmen = {'Name': ['Jahangir', 'Janavi', 'Manik', 'Lakshmi', 'Tanisha'], 'Zone': ['North', 'South', 'East', 'West', 'Central'], 'Sales': [5000, 7000, 3000, 8000, 6000]}
df = pd.DataFrame(salesmen)
print(df)Output
Name Zone Sales
0 Jahangir North 5000
1 Janavi South 7000
2 Manik East 3000
3 Lakshmi West 8000
4 Tanisha Central 6000
Answered By
2 Likes
Related Questions
Write a program to create a Series object that stores the table of number 5.
Write a program to create a Dataframe that stores two columns, which store the Series objects of the previous two questions (12 and 13).
Four dictionaries store the details of four employees-of-the-month as (empno, name). Write a program to create a dataframe from these.
A list stores three dictionaries each storing details, (old price, new price, change). Write a program to create a dataframe from it.