KnowledgeBoat Logo
|

Informatics Practices

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

Python Pandas

2 Likes

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.

Answered By

1 Like


Related Questions