Skip to main contentSkip to solution

On the basis of the following series 'ser1', state the output of the command that follows:

ser1

a100
b900
c700
d200
e500

print(ser1[ser1>700])

Solution

✅ Correct Option: 3

ser1>700 builds a Boolean series that is True only where the value is greater than 700. Here that is only b (900), since c is exactly 700 and the condition is strictly greater than.

Passing this Boolean series back into ser1[...] keeps only the True entries, with their original index labels. The output is the single row b 900.


Option 1: includes c (700), which would only appear for ser1>=700.

Option 2: this is the output of print(ser1>700) alone, which gives the Boolean series. But in this option, e is shown as True although 500 is not greater than 700, so it is wrong in any case.

Option 4: the index label is not reset to a number, so the original label b is kept.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question