______________ parameter is used in append( ) function of DataFrame to get the column labels in sorted order.
1.sorted .
2.sorter
3.sort
4.None of the above
Posted Date:-2021-12-13 11:35:01
A _______________ is a two-dimensional labelled data structure .
1.DataFrame
2.Series
3.List
4.None of the above
Posted Date:-2021-12-13 09:28:13
DF1.loc[ ] method is used to ______ # DF1 is a DataFrame
1.Add new row in a DataFrame ‘DF1’
2.To change the data values of a row to a particular value
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 09:51:17
Display first row of dataframe ‘DF’
1.print(DF.head(1))
2.print(DF[0 : 1])
3.print(DF.iloc[0 : 1])
4.All the above
Posted Date:-2021-12-13 12:04:33
If the following statement return (5, 3) it means _____ >>> DF.shape #DF is a DataFrame object
1.DataFrame DF has 3 rows 5 columns
2.DataFrame DF has 5 rows 3 columns
3.DataFrame DF has 3 rows 5 rowlabels
4.None of the above
Posted Date:-2021-12-13 11:48:32
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])
1. 2, 4
2.4, 6
3. 4, 4
4. 2, 6
Posted Date:-2021-12-13 09:44:19
The ________________parameter of append() method in DataFrame may be set to True, when we do not want to use row index labels.
1.ignore_index_val
2. ignore_index_value
3. ignore_index
4.None of the above
Posted Date:-2021-12-13 11:37:43
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)
1.0
2.1
3.2
4.3
Posted Date:-2021-12-13 09:35:17
The following statement will _________ df = df.drop(['Name', 'Class', 'Rollno'], axis = 1) #df is a DataFrame object
1.delete three columns having labels ‘Name’, ‘Class’ and ‘Rollno’
2. delete three rows having labels ‘Name’, ‘Class’ and ‘Rollno’
3.delete any three columns
4. return error
Posted Date:-2021-12-13 09:53:52
The parameter axis=’index’ of rename( ) function is used to specify that the __
1.row and column label is to be changed
2. column label is to be changed
3.row label is to be changed
4.None of the above
Posted Date:-2021-12-13 09:59:12
What we are doing in the following statement? dF1=dF1.append(dF2) #dF1 and dF2 are DataFrame object
1.We are appending dF1 in dF2
2.We are appending dF2 in dF1
3.We are creating Series from DataFrame
4.None of the above
Posted Date:-2021-12-13 11:32:47
When we create DataFrame from List of Dictionaries, then dictionary keys will become ___________
1.Column labels
2.Row labels
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 09:37:28
Which of the following attribute of DataFrame display all the values from DataFrame?
1.values
2.Values
3.. val
4. Val
Posted Date:-2021-12-13 11:46:36
Which of the following function is used to load the data from the CSV file into a DataFrame?
1.read.csv( )
2.readcsv( )
3.read_csv( )
4.Read_csv( )
Posted Date:-2021-12-13 12:01:03
Which of the following parameter is used to specify row or column in rename function of DataFrame?
1.rowindex
2.colindex
3.Both of the above
4.index
Posted Date:-2021-12-13 10:04:20
Write statement to transpose dataframe DF.
1.DF.T
2.DF.transpose
3.DF.t
4.DF.T( )
Posted Date:-2021-12-13 12:08:36
_____ parameter of append( ) method may be set to True when we want to raise an error if the row labels are duplicate.
1.verify_integrity
2.verifyintegrity
3.verify.integrity
4.None of the above
Posted Date:-2021-12-13 11:36:45
_________ data Structure has both a row and column index.
1. List
2.Series
3.DataFrame
4.None of the above
Posted Date:-2021-12-13 09:30:48
D1[ : ] = 77 , will set __________ values of a Data Frame ‘D1’ to 77.
1.Only First Row
2.Only First Column
3.all
4.None of the above
Posted Date:-2021-12-13 09:46:47
DataFrame created from single Series has ____ column.
1.1
2.2
3.n (Where n is the number of elements in the Series)
4.None of the above
Posted Date:-2021-12-13 09:43:33
DataFrame.loc[ ] is an important method that is used for ____________ with DataFrames
1.Label based indexing
2.Boolean based indexing
3.Both of the above
4.All the above
Posted Date:-2021-12-13 11:15:05
Display last two rows from dataframe ‘DF’
1.print(DF[-2 : -1])
2.print(DF.iloc[-2 : -1])
3.print(DF.tail(2))
4.All the above
Posted Date:-2021-12-13 12:05:18
Following statement will display ___________ rows from DataFrame ‘DF1’. >>> DF1.head()
1.all
2.2
3.3
4.5
Posted Date:-2021-12-13 11:53:53
If the DataFrame has more than one row with the same label, then DataFrame.drop( ) method will delete _____
1.first matching row from it.
2.all the matching rows from it
3. last matching row from it.
4.Return Error
Posted Date:-2021-12-13 09:56:30
In DataFrame, by default new column added as the _____________ column
1.First (Left Side)
2.Second
3.Last (Right Side)
4.Random
Posted Date:-2021-12-13 09:45:16
In given code dataframe ‘D1’ has _____ rows and ______ columns.
1.3, 3
2.3, 2
3. 2, 3
4.None of the above
Posted Date:-2021-12-13 09:42:48
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)
1.3, 3
2. 3, 4
3.3, 5
4.None of the above
Posted Date:-2021-12-13 09:40:23
In Pandas _______________ is used to store data in multiple columns.
1.Series
2. DataFrame
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 09:27:29
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'
1.Return error
2.Replace the already existing values.
3.Add new column
4.None of the above
Posted Date:-2021-12-13 09:49:40
In the following statement, if column ‘Rollno’ already exists in the DataFrame ‘D1’ then the assignment statement will __________ D1['Rollno'] = 11
1.Return error
2.Change all values of column Roll numbers to 11
3.Add new column
4.None of the above
Posted Date:-2021-12-13 09:50:47
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'
1.Return error
2.Replace the already existing values.
3.Add new column
4.None of the above
Posted Date:-2021-12-13 09:48:32
Parameters of read_csv( ) function is _____
1.sep
2.Header
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 11:59:39
The append() method of DataFrame can also be used to append ____________to a DataFrame
1.Series
2.Dictionary
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 11:39:45
The default value for sep parameter is ____
1.comma
2.semicolon
3.space
4.None of the above
Posted Date:-2021-12-13 12:01:45
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)
1.1
2.2
3.3
4.4
Posted Date:-2021-12-13 09:34:45
The following code create a dataframe named ‘D1’ with _______________ columns.
1.1
2.2
3.3
4.4
Posted Date:-2021-12-13 09:32:47
The following statement is __________ >>> DF=DF.rename({‘Maths’:’Sub1′,‘Science’:’Sub2′}, axis=’index’) #DF is a DataFrame
1.altering the row labels
2.altering the column labels
3.altering the row and column labels (both)
4.Error
Posted Date:-2021-12-13 10:02:17
The following statement will display ________ rows of DataFrame ‘DF’ print(df.loc[[True, False,True]])
1.1
2.2
3.3
4.4
Posted Date:-2021-12-13 11:28:48
The following statement will return the column as a _______ >>> DF.loc[: , 'Name'] #DF is a DataFrame object
1.DataFrame
2.Series
3.List
4.Tuple
Posted Date:-2021-12-13 11:15:46
The following two statement will return _______________ >>> DF.loc[:,'Name'] #DF is a DataFrame object >>> DF['Name'] #DF is a DataFrame object
1.Same Output
2.Name column of DataFrame DF
3.Both of the above
4.Different Output
Posted Date:-2021-12-13 11:27:44
To delete a column, the parameter axis of function drop( ) is assigned the value ____
1.0
2.1
3.2
4.3
Posted Date:-2021-12-13 09:52:54
To delete a row, the parameter axis of function drop( ) is assigned the value __
1.0
2.1
3.2
4.3
Posted Date:-2021-12-13 09:52:28
Transpose the DataFrame means _______
1.Row indices and column labels of the DataFrame replace each other’s position
2.Doubling the number of rows in DataFrame
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 11:50:43
We can add a new row to a DataFrame using the _____________ method
1.rloc[ ]
2. iloc[ ]
3.. loc[ ]
4.None of the above
Posted Date:-2021-12-13 09:46:05
We can create DataFrame from _____
1. Numpy arrays
2.List of Dictionaries
3.Dictionary of Lists
4.All the above
Posted Date:-2021-12-13 09:33:31
We can merge/join only those DataFrames which have same number of columns
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-13 11:31:59
We can use the ______ method to merge two DataFrames
1.merge( )
2.join( )
3. append( )
4.drop( )
Posted Date:-2021-12-13 11:30:33
What value should be given to axis parameter of rename function to alter column name?
1.column
2.columns
3.index
4.None of the above
Posted Date:-2021-12-13 10:00:40
What will happen if in the rename( ) function we pass only a value for a row label that does not exist?
1.it returns an error.
2.matching row label will not change .
3.the existing row label will left as it is.
4.None of the above
Posted Date:-2021-12-13 10:00:02
When we create DataFrame from Dictionary of List then Keys becomes the ______
1.Row Labels
2.Column Labels
3.Both of the above
4.None of the above
Posted Date:-2021-12-13 09:41:23
When we create DataFrame from Dictionary of List then List becomes the __________
1.Row Labels
2.Column Labels
3.Values of rows
4.None of the above
Posted Date:-2021-12-13 09:41:59
When we create DataFrame from List of Dictionaries, then number of columns in DataFrame is equal to the _
1.maximum number of keys in first dictionary of the list
2. maximum number of different keys in all dictionaries of the list
3.maximum number of dictionaries in the list
4.None of the above
Posted Date:-2021-12-13 09:38:49
When we create DataFrame from List of Dictionaries, then number of rows in DataFrame is equal to the _______
1.maximum number of keys in first dictionary of the list
2.maximum number of keys in any dictionary of the list
3. number of dictionaries in the list
4.None of the above
Posted Date:-2021-12-13 09:39:26
Which library is to be imported for creating DataFrame?
1.Python
2.DataFrame
3.Pandas
4.Random
Posted Date:-2021-12-13 09:31:18
Which method is used to change the labels of rows and columns in DataFrame?
1.change( )
2.rename( )
3.. replace( )
4.None of the above
Posted Date:-2021-12-13 09:58:32
Which method is used to delete row or column in DataFrame?
1.delete( )
2.del( )
3. drop( )
4.None of the above
Posted Date:-2021-12-13 09:51:57
Which of the following are ways of indexing to access Data elements in a DataFrame?
1.Label based indexing
2.Boolean Indexing
3.All of the above
4.None of the above
Posted Date:-2021-12-13 11:13:54
Which of the following attribute of DataFrame display the dimension of DataFrame
1.shape
2.size
3.dimension
4.values
Posted Date:-2021-12-13 11:47:22
Which of the following attribute of DataFrame is used to display column labels?
1.columns
2.index
3.dtypes
4.values
Posted Date:-2021-12-13 11:44:51
Which of the following attribute of DataFrame is used to display data type of each column in DataFrame?
1.Dtypes
2.DTypes
3.dtypes
4.datatypes
Posted Date:-2021-12-13 11:45:35
Which of the following attribute of DataFrame is used to display row labels?
1.columns
2.index
3.dtypes
4.values
Posted Date:-2021-12-13 11:44:08
Which of the following function display the last ‘n’ rows from the DataFrame?
1.head( )
2.tail( )
3.Tail( )
4.None of the above
Posted Date:-2021-12-13 11:54:35
Which of the following function is used to create DataFrame?
1.DataFrame( )
2.NewFrame( )
3.CreateDataFrame( )
4.None of the above
Posted Date:-2021-12-13 09:32:02
Which of the following is used to display first 2 rows of DataFrame ‘DF’?
1.DF.head( )
2.DF.header(2)
3.DF.head(2)
4.None of the above
Posted Date:-2021-12-13 11:51:37
Which of the following is used to give user defined column index in DataFrame?
1. index
2.column
3.columns
4.colindex
Posted Date:-2021-12-13 09:34:13
Which of the following statement is Transposing the DataFrame ‘DF1’?
1.DF1.transpose
2.DF1.T
3.DF1.Trans
4.DF1.t
Posted Date:-2021-12-13 11:53:08
Which property of dataframe is used to check that dataframe is empty or not?
1. isempty
2.IsEmpty
3.empty
4.Empty
Posted Date:-2021-12-13 11:55:43
Write a statement to delete column labelled as ‘R1’ of DataFrame ‘DF’..
1.DF= DF.drop(‘R1’, axis=0)
2.DF= DF.del(‘R1’, axis=0)
3.DF= DF.drop(‘R1’, axis=0, row = ‘duplicate’)
4.None of the above
Posted Date:-2021-12-13 10:03:23
Write statement to display the column labels of DataFrame ‘DF’
1.DF.Column
2.DF.column
3.DF.columns
4.DF.Columns
Posted Date:-2021-12-13 12:03:48
Write statement to display the data types of each column of dataframe ‘DF’.
1.DF.types( )
2.DF.dtypes
3.DF.dtypes( )
4.All the above
Posted Date:-2021-12-13 12:06:24
Write statement to display the dimension of dataframe ‘DF’.
1.DF.dim
2.DF.ndim
3.DF.dim( )
4.None of the above
Posted Date:-2021-12-13 12:07:31
Write statement to display the row labels of ‘DF’.
1. DF.Index
2.DF.index( )
3.DF.index
4.DF.row_index
Posted Date:-2021-12-13 12:03:07
Write the code to remove duplicate row labelled as ‘R1’ from DataFrame ‘DF1’
1.DF1 = DF1.drop(‘R1’, axis = 0)
2.DF1 = DF1.drop(‘R1’, axis = 1)
3.DF1 = DF1.del(‘R1’, axis = 0)
4.DF1 = DF1.del(‘R1’, axis = 1)
Posted Date:-2021-12-13 09:57:39
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
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-13 11:58:28
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
1.(3, 4)
2.(4, 3)
3. (3, 3)
4.All the above
Posted Date:-2021-12-13 11:57:01
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
1.9
2.12
3.6
4.None of the above
Posted Date:-2021-12-13 11:57:40