Question
2. Which of these prints is the length of a string 's'? Group of answer choices print len(s) print s.length() print s.len() print string.length(s) 3.
2. Which of these prints is the length of a string 's'?
Group of answer choices
print len(s)
print s.length()
print s.len()
print string.length(s)
3. How would you find out how many items are present in each dimension of ndarray x?
Group of answer choices
x.dtype
x.shape
x.size
x.ndim
5. Consider a dataframe, df, which looks like: ('Name' column had been set as Index)
Name | Age | Date_Of_Joining | Total_Experience |
Neil | 22 | 01/02/2013 | 2 |
Ruth | 30 | 01/04/2014 | 10 |
Sandy | 10 | 0 | 0 |
Joshua | 40 | 01/10/2009 | 20 |
Which of the following will you use to access only the Age and Date_Of_Joining of 'Sandy'? (Choose all that apply.)
Group of answer choices
df.loc[2,1:3]
df.iloc[3, 1:3]
df.iloc[2, :2]
df.loc['Sandy' , 'Age' : 'Date_Of_Joining']
50. df is a DataFrame object. In df, find the second largest value of 'rating' for 'banana'
Input: df = pd.DataFrame({'fruit': ['apple', 'banana', 'orange'] * 3,
'rating': np.random.rand(9),
'price': np.random.randint(0, 15, 9)})
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started