Comprehension

Consider the following series:
SeriesA = pd.series([1, 2, 3, 4, 5], index = ['a', 'b', 'c', 'd', 'e'])
SeriesB = pd.series([10, 20, -10, -50, -100], index=['z', 'y', 'a', 'c', 'e'])
SeriesA
Based on the above paragraph answer the following questions:

Question: 1

Find the output of: SeriesA + SeriesB

Updated On: Sep 12, 2024
  •    a       -9.0
         b       NaN
         с       -47.0
         d        NaN
         e        105.0
  •    a         -9.0
         b         NaN
         с         -47.0
         d         NaN
         e        -95.0
         y         NaN
         Z         NaN
  •    a        -9.0
         b         NaN
         с         -47.0
         d         NaN
         e        105.0
         y         NaN
         Z          NaN
  • Addition is not possible as index of both the series are different
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The correct option is(B): a -9.0 b NaNс -47.0d Ne -95.y NaNZ NaN
Was this answer helpful?
0
0
Question: 2

SeriesA.add(seriesB, fill_value = 0)

Updated On: Sep 12, 2024
  •    a    -9
         b     2
         C  - 47
         d     4
         e    105
         y     20
         Z     10
  •     a     9
          b     2
          C   - 47
          d      4
          e    105
  • a    -9.0
    b       2.0
    C      -47.0
    d       4.0
    e       -95.0
    y        20.0
    Z       10.0
  • a   -9.0
    b      2.0
    с     -47.0
    d       4.0
    e       105.0
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

The correct option is(C): a -9.0b 2.0C -47.0d 4.0e -95.0y 20.0Z 10.0
Was this answer helpful?
0
0
Question: 3

Identify the incorrect code statement to do some operations on two series

Updated On: Sep 12, 2024
  • seriesA.sub(seriesB, fill_value = 1000)
  • seriesA/seriesB
  • seriesA*series B
  • seriesA.multiply(seriesB, fill_values = NaN)
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

The correct option is(D): seriesA.multiply(seriesB, fill_values = NaN)
Was this answer helpful?
0
0
Question: 4

Identify the correct code statement to get the output:
a   - 10.0
b        0.0
c     - 150.0
d        0.0
e      - 500.0
y        0.0
Z        0.0

Updated On: Sep 12, 2024
  • seriesA.mul(seriesB, fill_value = 0)
  • seriesA*seriesB
  • seriesA/seriesB
  • seriesA.sub(seriesB, fill_value = 0)
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

The correct option is(A): seriesA.mul(seriesB, fill_value = 0)
Was this answer helpful?
0
0
Question: 5

Identify the correct statement in relation to mathematical operations on series :

Updated On: Sep 12, 2024
  • If the index of seriesA is not matched with index of seriesB, addition not possible.
  • While performing operations on series, index matching is implemented and all missing values are filled in with NaN by default.
  • add() function does not allow explicit specification of the fill value for any element in seriesA or seriesB that might be missing.
  • Multiplication and division are not possible with missing values.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The correct option is(B): While performing operations on series, index matching is implemented and all missing values are filled in with NaN by default.
Was this answer helpful?
0
0

Top Questions on Reading Comprehension

View More Questions