cudf.DataFrame.from_pandas#

classmethod DataFrame.from_pandas(dataframe, nan_as_null=None)#

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, converts np.nan values to null values. If False, leaves np.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