cudf.DataFrame.from_pandas#
- classmethod DataFrame.from_pandas(dataframe, nan_as_null=_NoDefault.no_default)[source]#
Convert from a Pandas DataFrame.
- Parameters:
- dataframePandas DataFrame object
A Pandas DataFrame object which has to be converted to cuDF DataFrame.
- nan_as_nullbool, Default True
If
True
, convertsnp.nan
values tonull
values. IfFalse
, leavesnp.nan
values as is.
- Raises:
- TypeError for invalid input type.
Examples
>>> import cudf >>> import pandas as pd >>> data = [[0,1], [1,2], [3,4]] >>> pdf = pd.DataFrame(data, columns=['a', 'b'], dtype=int) >>> cudf.from_pandas(pdf) a b 0 0 1 1 1 2 2 3 4