A B D 0 15 17 19 1 16 18 20 2 20 21 22
What will be the result of following code segment ?
(a) df[‘C’] = np.NaN
(b) df[‘C’] = [2,5]
(c) df[‘C’] = [12, 15, 27]
Ans
(a)
A B D C 0 15 17 19 NaN 1 16 18 20 NaN 2 20 21 22 NaN
Ans
(b) will produce Error
Ans
(c)
A B D C 0 15 17 19 12 1 16 18 20 15 2 20 21 22 27