Choose a topic to test your knowledge and improve your Python skills
In Pandas _______________ is used to store data in multiple columns.
A _______________ is a two-dimensional labelled data structure .
_________ data Structure has both a row and column index.
Which library is to be imported for creating DataFrame?
Which of the following function is used to create DataFrame?
The following code create a dataframe named ‘D1’ with _______________ columns.
We can create DataFrame from _____
Which of the following is used to give user defined column index in DataFrame?
The following code create a dataframe named ‘D1’ with ___________ columns. import pandas as pd LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20}] D1 = pd.DataFrame(LoD)
The following code create a dataframe named ‘D1’ with ______ rows. import pandas as pd LoD = [{'a':10, 'b':20}, {'a':5, 'b':10, 'c':20}] D1 = pd.DataFrame(LoD)
When we create DataFrame from List of Dictionaries, then dictionary keys will become ___________
When we create DataFrame from List of Dictionaries, then number of columns in DataFrame is equal to the _
When we create DataFrame from List of Dictionaries, then number of rows in DataFrame is equal to the _______
In given code dataframe ‘D1’ has ________ rows and _______ columns. import pandas as pd LoD = [{‘a’:10, ‘b’:20}, {‘a’:5, ‘b’:10, ‘c’:20},{‘a’:7, ‘d’:10, ‘e’:20}] D1 = pd.DataFrame(LoD)
When we create DataFrame from Dictionary of List then Keys becomes the ______
When we create DataFrame from Dictionary of List then List becomes the __________
In given code dataframe ‘D1’ has _____ rows and ______ columns.
DataFrame created from single Series has ____ column.
In given code dataframe ‘D1’ has _____ rows and _____ columns. import pandas as pd S1 = pd.Series([1, 2, 3, 4], index = ['a', 'b','c','d']) S2 = pd.Series([11, 22, 33, 44], index = ['a', 'bb','c','dd']) D1 = pd.DataFrame([S1,S2])
In DataFrame, by default new column added as the _____________ column
We can add a new row to a DataFrame using the _____________ method
D1[ : ] = 77 , will set __________ values of a Data Frame ‘D1’ to 77.
In the following statement, if column ‘Rollno’ already exists in the DataFrame ‘D1’ then the assignment statement will _____________ D1['Rollno'] = [1,2,3] #There are only three rows in DataFrame D1'
In the following statement, if column ‘Rollno’ already exists in the DataFrame ‘D1’ then the assignment statement will __________ D1['Rollno'] = [1, 2] #There are only three rows in DataFrame D1'
In the following statement, if column ‘Rollno’ already exists in the DataFrame ‘D1’ then the assignment statement will __________ D1['Rollno'] = 11
DF1.loc[ ] method is used to ______ # DF1 is a DataFrame
Which method is used to delete row or column in DataFrame?
To delete a row, the parameter axis of function drop( ) is assigned the value __
To delete a column, the parameter axis of function drop( ) is assigned the value ____
The following statement will _________ df = df.drop(['Name', 'Class', 'Rollno'], axis = 1) #df is a DataFrame object
If the DataFrame has more than one row with the same label, then DataFrame.drop( ) method will delete _____
Write the code to remove duplicate row labelled as ‘R1’ from DataFrame ‘DF1’
Which method is used to change the labels of rows and columns in DataFrame?
The parameter axis=’index’ of rename( ) function is used to specify that the __
What will happen if in the rename( ) function we pass only a value for a row label that does not exist?
What value should be given to axis parameter of rename function to alter column name?
The following statement is __________ >>> DF=DF.rename({‘Maths’:’Sub1′,‘Science’:’Sub2′}, axis=’index’) #DF is a DataFrame
Write a statement to delete column labelled as ‘R1’ of DataFrame ‘DF’..
Which of the following parameter is used to specify row or column in rename function of DataFrame?
Which of the following are ways of indexing to access Data elements in a DataFrame?
DataFrame.loc[ ] is an important method that is used for ____________ with DataFrames
The following statement will return the column as a _______ >>> DF.loc[: , 'Name'] #DF is a DataFrame object
The following two statement will return _______________ >>> DF.loc[:,'Name'] #DF is a DataFrame object >>> DF['Name'] #DF is a DataFrame object
The following statement will display ________ rows of DataFrame ‘DF’ print(df.loc[[True, False,True]])
We can use the ______ method to merge two DataFrames
We can merge/join only those DataFrames which have same number of columns
What we are doing in the following statement? dF1=dF1.append(dF2) #dF1 and dF2 are DataFrame object
______________ parameter is used in append( ) function of DataFrame to get the column labels in sorted order.
_____ parameter of append( ) method may be set to True when we want to raise an error if the row labels are duplicate.
The ________________parameter of append() method in DataFrame may be set to True, when we do not want to use row index labels.
The append() method of DataFrame can also be used to append ____________to a DataFrame
Which of the following attribute of DataFrame is used to display row labels?
Which of the following attribute of DataFrame is used to display column labels?
Which of the following attribute of DataFrame is used to display data type of each column in DataFrame?
Which of the following attribute of DataFrame display all the values from DataFrame?
Which of the following attribute of DataFrame display the dimension of DataFrame
If the following statement return (5, 3) it means _____ >>> DF.shape #DF is a DataFrame object
Transpose the DataFrame means _______
Which of the following is used to display first 2 rows of DataFrame ‘DF’?
Which of the following statement is Transposing the DataFrame ‘DF1’?
Following statement will display ___________ rows from DataFrame ‘DF1’. >>> DF1.head()
Which of the following function display the last ‘n’ rows from the DataFrame?
Which property of dataframe is used to check that dataframe is empty or not?
Write the output of the statement >>>df.shape , if df has the following structure. Name Class Rollno 0 Amit 6 1 1 Anil 7 2 2 Ravi 8 3
Write the output of the statement >>>df.size , if df has the following structure: Name Class Rollno 0 Amit 6 1 1 Anil 7 2 2 Ravi 8 3
Write the output of the statement >>>df.empty , if df has the following structure: Name Class Rollno 0 Amit 6 1 1 Anil 7 2 2 Ravi 8 3
Parameters of read_csv( ) function is _____
Which of the following function is used to load the data from the CSV file into a DataFrame?
The default value for sep parameter is ____
Write statement to display the row labels of ‘DF’.
Write statement to display the column labels of DataFrame ‘DF’
Display first row of dataframe ‘DF’
Display last two rows from dataframe ‘DF’
Write statement to display the data types of each column of dataframe ‘DF’.
Write statement to display the dimension of dataframe ‘DF’.
Write statement to transpose dataframe DF.