Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1020 Bytes

__new__.rst

File metadata and controls

42 lines (29 loc) · 1020 Bytes

datatable.stype.__new__

__new__(self, value) --

Find an stype corresponding to value.

This method is called when you attempt to construct a new stype object, for example dt.stype(int). Instead of actually creating any new stypes, we return one of the existing stype values.

Parameters

value: str | type | np.dtype

An object that will be converted into an stype. This could be a string such as "integer" or "int" or "int8", a python type such as bool or float, or a numpy dtype.

return: stype

An stype that corresponds to the input value.

except: ValueError

Raised if value does not correspond to any stype.

Examples

>>> dt.stype(str) stype.str64

>>> dt.stype("double") stype.float64

>>> dt.stype(numpy.dtype("object")) stype.obj64

>>> dt.stype("int64") stype.int64