Questions

1 Marks Each

🎯

Test yourself on this topic

11 questions · timed · auto-graded

Question 11 Mark
Mention the different Types of Data structures in pandas.
Answer
There are two data structures supported by pandas library, Series and DataFrames.
View full question & answer
Question 21 Mark
How will you append new rows to a pandas DataFrame?
Answer
Pandas dataframe.append() function is used to append rows of other dataframe to the end of the given dataframe, returning a new dataframe object.
View full question & answer
Question 31 Mark
Define ReIndexing.
Answer
Reindexing changes the row labels and column labels of a DataFrame. To reindex means to confirm the data to match a given set of labels along a particular axis.
View full question & answer
Question 61 Mark
Write the statements to create the Series with given dictionary SectionNames as index and Section strength as values. Also answer the questions given below:sectionNames = ['A','B','C','D','E','F']
sectionStrength = [34,50,60,54,45,40]
(a) (i) To print the first 5 records.
(ii) To print the last 3 records.
(iii) To print the sum of the strength using loop.
(b) Write the output of the following:
(i) sections.iloc[4]
(ii) sections.loc['B']
(iii) sections[3]
Answer
(a) sections = pd.Series(sectionStrength,index = sectionNames)(i) sections.head()
(ii) sections.tail(3)

(b) (i) 45
(ii) 50
(iii) 54
View full question & answer
Question 71 Mark
Write the statements to answer the given questions:

(i) Create the Series of the above dictionary.

(ii) To print the index.

Answer
(i) sports = pd.Series(sportsDict)

(ii) sports.index

View full question & answer
Question 81 Mark
Write the statement to create the series of the list animals = ['Tiger', 'Bear', 'Lion'].
Answer
import pandas as pd
pd.Series(animals)
View full question & answer
Question 91 Mark
Write the statement to print out all the version information of the libraries that are required by the pandas library.
Answer
pd.show_versions()
View full question & answer
1 Marks Each - Computer Science STD 12 Science Questions - Vidyadip