Find the output of the following Python code: import pandas as pd…

2023

Find the output of the following Python code: import pandas as pd M=pd.Series({'P':10, 'Q':90}) print(M)

  1. A.

    P Q

    10 90

  2. B.

    P 10

    Q 90

  3. C.

    0 P 10

    1 Q 90

  4. D.

    10 P

    90 Q

Attempted by 135 students.

Show answer & explanation

Correct answer: B

Creating a Series from a dictionary makes the keys the index and the values the data. So the output is: P 10 Q 90 This matches option (2).

Explore the full course: Bpsc