Data Handling Using Pandas-1 NCERT Solution || Data Handling Using Pandas-1 Class 12 Solution || Data Handling Using Pandas-1 Class 12 IP Solution || Data Handling Using Pandas-1 Information Practices Solution || NCERT Data Handling Using Pandas-1 Solution || Data Handling Using Pandas-1 Class 12 IP || Data Handling Using Pandas-1 Solution


Note :-  Please click on Question to get solution of that Question !!!


Q1. What is a Series and how is it different from a 1-D array, a list and a dictionary?



Q2. What is a DataFrame and how is it different from a 2-D array?



Q3. How are DataFrames related to Series?



Q4. What do you understand by the size of (i) a Series, (ii) a DataFrame?



Q5. Create the following Series and do the specified operations:

a) EngAlph, having 26 elements with the alphabets as values and default index values.
b) Vowels, having 5 elements with index labels ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’ and all the five values set to zero. Check if it is an empty series.
c) Friends, from a dictionary having roll numbers of five of your friends as data and their first name as keys.
d) MTseries, an empty Series. Check if it is an empty series.
e) MonthDays, from a numpy array having the number of days in the 12 months of a year. The labels should be the month numbers from 1 to 12.




Q6. Using the Series created in Question 5, write commands for the following:
a) Set all the values of Vowels to 10 and display the Series.
b) Divide all values of Vowels by 2 and display the Series.
c) Create another series Vowels1 having 5 elements with index labels ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’ having values [2,5,6,3,8] respectively.
d) Add Vowels and Vowels1 and assign the result to Vowels3.
e) Subtract, Multiply and Divide Vowels by Vowels1.
f) Alter the labels of Vowels1 to [‘A’, ‘E’, ‘I’, ‘O’, ‘U’].




Q7. Using the Series created in Question 5, write commands for the following:
a) Find the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.
b) Rename the Series MTseries as SeriesEmpty.
c) Name the index of the Series MonthDays as monthno and that of Series Friends as Fname.
d) Display the 3rd and 2nd value of the Series Friends, in that order.
e) Display the alphabets ‘e’ to ‘p’ from the Series EngAlph.
f) Display the first 10 values in the Series EngAlph.
g) Display the last 10 values in the Series EngAlph.
h) Display the MTseries.




Q8. Using the Series created in Question 5, write commands for the following:
a) Display the names of the months 3 through 7 from the Series MonthDays.
b) Display the Series MonthDays in reverse order.




Q9. Create the following DataFrame Sales containing year wise sales figures for five sales persons in INR. Use the years as column labels, and sales perso names as row labels.



Q10. Use the DataFrame created in Question 9 above to do the following:
a) Display the row labels of Sales.
b) Display the column labels of Sales.
c) Display the data types of each column of Sales.
d) Display the dimensions, shape, size and values of Sales.
e) Display the last two rows of Sales.
f) Display the first two columns of Sales.
g) Create a dictionary using the following data. Use this dictionary to create a DataFrame Sales2.



Q11. Use the DataFrame created in Question 9 above to do the following:
a) Append the DataFrame Sales2 to the DataFrame Sales.
b) Change the DataFrame Sales such that it becomes its transpose.
c) Display the sales made by all sales persons in the year 2017.
d) Display the sales made by Madhu and Ankit in the year 2017 and 2018.
e) Display the sales made by Shruti 2016.
f) Add data to Sales for salesman Sumeet where the sales made are [196.2, 37800, 52000, 78438, 38852] in the years [2014, 2015, 2016, 2017, 2018] respectively.
g) Delete the data for the year 2014 from the DataFrame Sales.
h) Delete the data for sales man Kinshuk from the DataFrame Sales.
i) Change the name of the salesperson Ankit to Vivaan and Madhu to Shailesh.
j) Update the sale made by Shailesh in 2018 to 100000.
k) Write the values of DataFrame Sales to a comma separated file SalesFigures.csv on the disk. Do not write the row labels and column labels.
l) Read the data in the file SalesFigures.csv into a DataFrame SalesRetrieved and Display it. Now update the row labels and column labels of SalesRetrieved to be the same as that of Sales.


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post