Informatics Practices
To specify datatype int16 for a Series object, you can write :
- pd.Series(data = array, dtype = int16)
- pd.Series(data = array, dtype = numpy.int16)
- pd.Series(data = array.dtype = pandas.int16)
- 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
Which of the following statement will import pandas library ?
- Import pandas as pd
- import Pandas as py
- import pandas as pd
- import panda as pd
To create an empty Series object, you can use :
- pd.Series(empty)
- pd.Series(np.NaN)
- pd.Series( )
- all of these
To get the number of dimensions of a Series object, …………… attribute is displayed.
- index
- size
- itemsize
- ndim
To get the size of the datatype of the items in Series object, you can display …………… attribute.
- index
- size
- itemsize
- ndim