KnowledgeBoat Logo
|

Informatics Practices

What type of error is returned by the following statement ?

import pandas as pa
pa.Series([1, 2, 3, 4], index = ['a', 'b', 'c'])
  1. Value Error
  2. Syntax Error
  3. Name Error
  4. Logical Error

Python Pandas

1 Like

Answer

Value Error

Reason — When specifying indexes explicitly using an index sequence, we must provide indexes equal to the number of values in the data array. Providing fewer or more indices will lead to an error, i.e., a ValueError.

Answered By

1 Like


Related Questions