Choose a topic to test your knowledge and improve your Python skills
Write the statement to get NewDelhi as output using positional index. import pandas as pd S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['India', 'USA', 'UK', 'France'])
We can access elements in Series by using ________ index and ____________index.
Write the output of the following : import pandas as pd S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['India', 'USA', 'UK', 'France']) print(S1['India', 'UK'])
Which of the following statement will print Series ‘S1’ in reverse order?
How many values will be modified by last statement of given code ? import pandas as pd S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['A', 'B', 'C', 'D']) S1['A' : 'C'] = 'ND'
How many values will be modified by last statement of given code ? import pandas as pd S1 = pd.Series(['NewDelhi', 'WashingtonDC', 'London', 'Paris'], index=['A', 'B', 'C', 'D']) S1['A' : 'C'] = 'ND'
S1.values will return all the values of Series ‘S1’ in ___
Which of the following property/attribute return total number of values in Series ‘S1’?
Which of the following attributes returns True if there is no value in Series?
Which of the following attributes returns all the values of Series?
Write the output of the following code: import pandas as pd S1=pd.Series() print(pd.Series().empty)
Write the output of the following code : import pandas as pd S1=pd.Series([1,2,3,4]) S2=pd.Series([7,8]) S3=S1+S2 print(S3.size)
Which of the following statement shows first five values of Series ‘S1’?
Write the output of the following : import pandas as pd S1=pd.Series([1,2,3,4]) S2=pd.Series([7,8]) print((S1+S2).count())
Which of the following returns number of non-NaN values of Series?
Write the output of the following : import pandas as pd S1=pd.Series([1,2,3,4]) S2=pd.Series([7,8,9,10]) S2.index=['a','b','c','d'] print((S1+S2).count())
We can perform _____________ on two series in Pandas.
Which of the following method is used to add two series?
Which of the following statement will display the difference of two Series ‘A’ and ‘B’?
Which of the following fills the missing values in Series? a.
Which of the following function is used for basic mathematical operations in Series?
Which of the following statement is replacing missing values of Series A and Series B by 100 .
Mathematical Operations on two Series object is done by matching ______
Which of the following statement will display values more than 40 from Series ‘S1’?
Which of the following statement will return 10 values from the bottom/end of the Series ‘S1’?
Which of the following are valid operations on Series ‘S1’?
When an operation is carried out on every value of Series object is called __
Which of the following statement will modify the first three values of Series ‘S1’?
What is the index value of 31 in given Series ‘S1’? import pandas as pd S1=pd.Series([1,2,31,4], index = ['a','b','c','d'])
S2 is ____________ in given code ? S2 = S1[2 : 5] #S1 is a Series object
Python libraries contain a collection of built-in __
Which of the following library help to visualize data?
Which of the following is a high level data manipulation tool used for analyzing data.?
Pandas is the ____ library.
Pandas Series is size __________ and value _____
Pandas DataFrame is size ________ and value ____
data’ in the following code could be _____ S1 = pd.Series(data)
Choose the correct statement : Statement1 : A Numpy array requires homogeneous data. Statement2 : Pandas DataFrame can have heterogeneous data.
Amit is working in an IT company. His boss asked him to prepare a chart in python. He is confused that which library will support plotting graph and data visualization in python. Help him to find the library
By using Matplotlib, we can generate __
Installing Pandas is very similar to installing __
By default Series have _______ data labels starting from ___.
Write a statement to import pandas with alias name ‘pds’
What is the index value of “Ravi” in the following Series? import pandas as pd S1 = pd.Series["Ram", "Raju", "Ravi", "Ramesh", "Rishabh"]
An output of series ‘S1’ is shown below, are the data values in ‘S1 and _ are the data labels in ‘S1’. Output: Feb 2 Mar 3 Apr 4 dtype: int64
What is the data type of given series ‘S1’? import pandas as pd S1=pd.Series('a', index=(2.0, 3.0, 4.0, 5.0)) print(S1)
How many elements will be there in given series ‘S1’? import pandas as pd S1=pd.Series('python practice') print(S1)
Two common ways for accessing the elements of a series are _________ and ____
How many times value ’10’ will be displayed in the given series ‘S1’? import pandas as pd S1=pd.Series(10, index = range(1, 10, 3)) print(S1)
Which of the following statement is correct to add NaN value in series?
Which of the following is parameter of Series( ) function?
What is the data type of series ‘S1’ given below ? S1=pd.Series([11, 12.5, “ok”])
Which of the following attribute of Series is used to set the name of Series object?
Which of the following attribute is used to check NaN value in Series?
Which of the following attribute of Series returns the tuple?
What type of error is returned, when the length of index and the length of data in Series() function is not same?
Write a statement to display 12.5 as output using positional indexing. import pandas as pd S1=pd.Series([11, 12.5, None, 6], index=["J","F","M","A"])
Can a Series have duplicate index value?
Rosy wants to display the series ‘S1’ in reverse order. Help her to find the correct code.
Number of students in each section of class 9th is stored in series ‘S1’. Write a statement to change the value of section ‘A’ and ‘B’ to 50. A 41 B 44 C 40 D 42 E 47
S1[0 : 2] = 50
Series ‘S1’ has five values with index value (0, 1, 2, 3, 4) and series ‘S2’ has five values with index (2, 3, 4, 5, 6). What will be the total number of values in ‘S3’ if S3 = S1 + S2
Raman performed addition of series ‘S1’ and ‘S2’ and store the result in series ‘S3’. Both the series ‘S1’ and ‘S2’ have five mismatching index value. How many NaN will be there in ‘S3’?
Which of the following statement return Boolean result? import pandas as pd S1=pd.Series([11, 12, 5, 6,9]) print(S1) #Statement 1 print(S1>7) #Statement 2 print(S1[S1>7]) #Statement 3
Which of the following statement return Filtered result? import pandas as pd S1=pd.Series([11, 12, 5, 6,9]) print(S1) #Statement 1 print(S1>7) #Statement 2 print(S1[S1>7]) #Statement 3
Amit is working in an IT firm as Data Manager. He stored the salary of all employees in Series named “Empser”. His Boss asked him to filter the employees whose salary is more than 20000. Help him to find the correct code. Sample of data stored is shown below. 0 25000 1 20000 2 21000 3 30000
_________ function is used to sort a Series object on the basis of values.
Anshuman wants to create a series named ‘S1’. He has written the following codes. His friend Shubham checked the code and said that one of the code given below is not working. As a friend of Anshuman, help him to find the incorrect code. a. S1=pd.Series(data=[11, 12, 5, 6,9],index=[1,2,3,4,5])
Sonal is a class XII student. She is learning “Series” in Python. She is confused in “parameter of Series( ) function”. Help her to find the incorrect parameter.
Roshan has written few points about iloc( ) function of Series in Python. His friend Suman told that one of the written statement is not correct. Help him to find the incorrect statement.
print(S1[-1]) will return ___________ #’S1′ is a series
>>> S1[1:3] = 50 will update the value of ___________ elements
_________ statement will assigns a name to the Series ‘S1’.
Write the output of the following: import pandas as pd S1=pd.Series(data=[11, 12, None, 6,9,7],index=[1,12,3,4,2,4]) print(S1.count())
While performing mathematical operations on series, index matching is implemented and all missing values are filled in with ___________ by default
Mr. Kumar is working in an IT company. He stored the salaries of all the employees of January month in Series ‘Jan_Sal’ and salaries of February month in Series ‘Feb_Sal’. Now he wants to add the salaries of both months. He has written the following statement. Identify the correct one.
Which of the following method is used to subtract the two series?