NEW
Font size
WorksheetsClass-XII_IP_Revision-3
Total questions: 10
Worksheet time: 8mins
1.A two dimensional labelled array that is an ordered collection of columns to store heterogeneous data type is
Series
Numpy Array
Dataframe
Panel
2. How can you create a DataFrame in pandas from a dictionary?
df = pandas.DataFrame.from_dict()
df = pandas.read_dict()
df = pandas.DataFrame(dict)
df = pandas.create.DataFrame()
3. Which of the following will return the column labels of a DataFrame?
df.rows()
df.columns
df.labels()
df.colnames()
4.Which method is used to remove rows with missing values?
df.fillna()
df.drop()
df.remove()
df.dropna()
5. What does df.shape return?
Number of columns only
Number of rows only
(Number of rows, Number of columns)
Size of each column
6. Which function returns the total number of non-null values in each column?
df.count()
df.size()
df.length()
df.notnull()
7.How can you read a CSV file into a DataFrame?
df = pandas.read_table('file.csv')
df = pandas.open_csv('file.csv')
df = pandas.read_csv('file.csv')
df = pandas.readfile('file.csv')
8.Which code will return only the first 3 rows of a DataFrame df?
df.tail(3)
df.loc[0:3]
df.head(3)
df.first(3)
9.What will df.iloc[0] return?
First row of the DataFrame
First column
Column labels
Error
10.What is the output of print(df.dtypes)?
Shows missing values
Shows datatype of each column
Shows column names
Shows column values
