Informatics Practices
Answer
import pandas as pd
s = pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd'])
print(s)
s.info()Output
a 1
b 2
c 3
d 4
dtype: int64
<class 'pandas.core.series.Series'>
Index: 4 entries, a to d
Series name: None
Non-Null Count Dtype
-------------- -----
4 non-null int64
dtypes: int64(1)
memory usage: 64.0+ bytes
Related Questions
Write a program that stores the sales of 5 fast moving items of a store for each month in 12 Series objects, i.e., S1 Series object stores sales of these 5 items in 1st month, S2 stores sales of these 5 items in 2nd month, and so on.
The program should display the summary sales report like this :
Total Yearly Sales, item-wise (should display sum of items' sales over the months) Maximum sales of item made : <name of item that was sold the maximum in whole year> Maximum sales for individual items Maximum sales of item 1 made : <month in which that item sold the maximum> Maximum sales of item 2 made : <month in which that item sold the maximum> Maximum sales of item 3 made : <month in which that item sold the maximum> Maximum sales of item 4 made : <month in which that item sold the maximum> Maximum sales of item 5 made : <month in which that item sold the maximum>Three Series objects store the marks of 10 students in three terms. Roll numbers of students form the index of these Series objects. The Three Series objects have the same indexes.
Calculate the total weighted marks obtained by students as per following formula :
Final marks = 25% Term 1 + 25% Term 2 + 50% Term 3Store the Final marks of students in another Series object.
Write a program to create three different Series objects from the three columns of a DataFrame df.
Write a program to create three different Series objects from the three rows of a DataFrame df.