CBSE Class 12 Informatics Practices Question 38 of 167

Python Pandas — I — Question 3

Back to all questions
3
Question

Question 3

To specify datatype int16 for a Series object, you can write :

  1. pd.Series(data = array, dtype = int16)
  2. pd.Series(data = array, dtype = numpy.int16)
  3. pd.Series(data = array.dtype = pandas.int16)
  4. all of the above
Answer

pd.Series(data = array, dtype = numpy.int16)

Reason — The syntax to specify data type for a Series object is : <Series Object> = pandas.Series(data = None, index = None, dtype = None). Therefore, according to this syntax, pd.Series(data = array, dtype = numpy.int16) is correct.