We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
DATA HANDLING USING PANDAS –1
SHORT ANSWER QUESTIONS
1. Write the syntax and description for min, sum, describe and idxmax functions in python pandas series?
2. What is NaN in Pandas?
3. Let us assume, we want to import data from the CSV file to data frame. While importing data we don’t want first two rows to be imported. Write a python program to satisfy this requirement?
CSV file name is ‘sample.csv’, it is present in the same directory.
4. What is difference between reindex( ) and rename( )?
5. What is the use of pipe( ) in python pandas?
6. What are the difference between matplotlib and pyplot?
7. How does dataframe object specify indexes to its data rows?
8. Give difference between pivot() and pivot_table( )?
9. Mention at least four functions for aggregation in Pandas.
10. Give difference between apply( ) and applymap( ) functions in Pandas?
11. How can we fill in Missing values in DataFrame?
12. What is the difference between Series and DataFrame?
13. List some advantages of CSV file format?
14. Write commands to print the following details of a series object
(a) empty series (b) indexes of the series (c) data type of the data elements of the series (d) To display whether the series has NaN values
15. Distinguish between head( ) and tail( ) functions?
16. Find the output of the following code:
import pandas as pd data = [{'a': 10, 'b': 20},{'a': 6, 'b': 32, 'c': 22}] #with two column indices, values same as dictionary keys df1 = pd.DataFrame(data, index=['first', 'second'], columns=['a', 'b']) #With two column indices with one index with other name df2 = pd.DataFrame(data, index=['first', 'second'], columns=['a', 'b1']) print(df1) print(df2)