riptable.Utils.pandas_utils

Utility function for rt. These functions (may) have dependence on additional libraries and therefore should _NOT_ be imported in __init__.py or any other such core (like rt_appconfig.py).

Functions

dataset_as_pandas_df(ds)

This function is deprecated, please use riptable.Dataset.as_pandas_df method.

dataset_from_pandas_df(df[, tz])

This function is deprecated, please use riptable.Dataset.from_pandas.

fastarray_to_pandas_series(arr[, unicode, use_nullable])

pandas_series_to_riptable(series[, tz])

riptable.Utils.pandas_utils.dataset_as_pandas_df(ds)

This function is deprecated, please use riptable.Dataset.as_pandas_df method.

Create a pandas DataFrame from a riptable Dataset. Will attempt to preserve single-key categoricals, otherwise will appear as an index array. Any bytestrings will be converted to unicode.

Parameters:

ds (Dataset) – The riptable Dataset to be converted.

Return type:

DataFrame

See also

riptable.Dataset.to_pandas

riptable.Utils.pandas_utils.dataset_from_pandas_df(df, tz='UTC')

This function is deprecated, please use riptable.Dataset.from_pandas.

Creates a riptable Dataset from a pandas DataFrame. Pandas categoricals and datetime arrays are converted to their riptable counterparts. Any timezone-unaware datetime arrays (or those using a timezone not recognized by riptable) are localized to the timezone specified by the tz parameter.

Recognized pandas timezones:

UTC, GMT, US/Eastern, and Europe/Dublin

Parameters:
  • df (DataFrame) – The pandas DataFrame to be converted

  • tz (string) – A riptable-supported timezone (‘UTC’, ‘NYC’, ‘DUBLIN’, ‘GMT’)

Return type:

Dataset

See also

riptable.Dataset.from_pandas, riptable.Dataset.to_pandas

riptable.Utils.pandas_utils.fastarray_to_pandas_series(arr, unicode=True, use_nullable=True)
riptable.Utils.pandas_utils.pandas_series_to_riptable(series, tz='UTC')