Ip File
Ip File
Ip File
Ans.
4. Create a Dataframe using a ndarray of values and show
mean, median, maximum value, minimum value, mode.
05. Create a Data Frame quarterly sales where each row
contains the item category, item name, and expenditure.
Group the rows by the category, and print the total
expenditure per category.
Ans.
06. Filter out rows based on different criteria such as
duplicate rows.
Ans.
07. Find the sum of each column, or find the column with
the lowest mean.
Ans.
8. Do the following :
2. subtract the mean of a row from each element of the row in a dataframe.
Ans.
9.A dictionary Grade contains the following data: Grade={'Name':['Rashmi', 'Harsh', 'Ganesh', 'Priya',
'Vivek', 'Anita', 'karthik'], 'Grade':['A1', 'A2', 'B1', 'A1', 'B2', 'A2', 'A1']}
c. Add a column called percentage with following data: [92, 89, None, 95, 68, None, 93]
i. Gr.drop(0, axis=0)
result csv
11. Implement Describe method on a dataframe display
its output.
12. Write a program to iterate over a dataframe
containing names and marks, which then calculates
grades as per marks and adds them to the grade column.
Marks Grade
Marks>=90 A+
Marks 70-90 A
Marks 60-69 B
Marks 50-59 C
Marks 40-49 D
Marks <40 F
13. Consider a DataFrame ndf as shown below:
Note: above histogram is drawn with bars as per bins already decided for age
group
[10,15,20,25,30,35,40,45,50] and height of bars as 1 point for 10 as 10 is one time
only
, 2 points for 20 because these values are for two time and 4 points for 40
because it is
for four times.
16. Generally ten different prices of a stock are stored.
However, for ABC Co only 5 prices are available for a
dat:[74.25, 76.06, 69.5, 72.55, 81.5] Write a program to
create a bar chart with the given prices:
The graph should be plotted between the limits -2
to 10 on x-axis
There should be tick for every potted point