DataFrame.astype(dtype, copy=True, raise_on_error=True, **kwargs)
[source]
Cast object to input numpy.dtype Return a copy when copy = True (be really careful with this!)
Parameters: |
dtype : data type, or dict of column name -> data type Use a numpy.dtype or Python type to cast entire pandas object to the same type. Alternatively, use {col: dtype, ...}, where col is a column label and dtype is a numpy.dtype or Python type to cast one or more of the DataFrame’s columns to column-specific types. raise_on_error : raise on invalid input kwargs : keyword arguments to pass on to the constructor |
---|---|
Returns: |
casted : type of caller |
© 2011–2012 Lambda Foundry, Inc. and PyData Development Team
© 2008–2011 AQR Capital Management, LLC
© 2008–2014 the pandas development team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.19.2/generated/pandas.DataFrame.astype.html