Professional Documents
Culture Documents
SOURCE CODE
SOURCE CODE
9.Create a data frame using a dictionary with the given data: '2015':
[256,452,635,965], '2016':[745,785,478,547],
'2017':[452,474,725,854], '2018':[1021,958,528,425]
index=['Qtr1','Qtr2','Qtr3','Qtr4']
Find the following:
i) Replace all negative values with zero and all nan with 999.
ii) Display the resultant dataframe.
iii) Remove the first row and display the new dataframe.
12.Create a dataFrame using student name , roll number and grade as the
keys.Trasfer this dataframe to CSV file using tab as separator. Later load the
above csv file and display the data.
13. Create a data frame with series 1 as author and series 2 as article. Then add a
new column age to the data frame . Plot a bar graph showing age and article.
OUTPUT
14. Create a csv file with id ,fname, marks in English, accountancy and IP. Read
csv using dataframe and do the following
OUTPUT
17. Create a dataframe using a dictionary with given data
'Name':pd.Series(['Tom','James','Ricky','Vin',]),
'Age':pd.Series([25,26,25,23]), 'Rating':pd.Series([4.23,3.24,3.98,2.56] and
perform the following: i) Print the number of values in column age ii) Print
number of values in each column and each row iii) Iterate over rows and
columns
OUTPUT
18. Write a program to draw line charts for the following: a. Show
the population of india vs Pakistan from 1960 – 2010
Ind=[449.48, 553.57, 696.783, 870.133,1000.4, 1309.1]
pak=[44.91, 58.06, 78.07, 107.7, 138.5, 170.6]
b. Show the unemployment rate from 1920 to 2010
Year = [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]
Unemployment_Rate = [9.8, 12, 8, 7.2, 6.9, 7, 6.5, 6.2, 5.5, 6.3]
SOURCE CODE
19. Program to plot line chart to solve the following algebraic expressions
i) 10X+14 ii) Y2=4X
SOURCE CODE
20. Create bar chart to show the following:
i). Represent the performance of programming languages:
python","c++","Java","Perl","Scala","lisp" given by different users as
10,8,6,4,2,1 respectively using horizontal barchart
ii) Represent class as [ "V","VI","VII","VIII","IX","X”] and strength =[49,38,50,37,43,39] using a normal bar
chart
SOURCE CODE
21. Input the name and mark of 4 students in two lists. Represent their performance using a bar chart.
SOURCE CODE
22. Create a csv using the data about cars (name, price in lakhs and mileage) as given below:
'car':['BMW','Honda','Toyota', 'Hyundai'], 'price':[ 100,8,45,7],
'mileage':[39,27,26,26]}
Read the above csv and plot a bar chart represents car and its price.
SOURCE CODE
OUTPUT
23. Create an array having 30 elements between 5 and 50. Plot the following having 10 bins. i)
Simple histogram ii) Horizontal histogram iii) Step-Type histogram iv) Cumulative histogram
SOURCE CODE
OUTPUT