12

I am able to convert dataframe to h2oframe but how can I convert back to a dataframe? If this is possible not can I convert it to a python list?

import pandas as pd
import h2o
df = pd.DataFrame({'1': [2838, 3222, 4576, 5665, 5998], '2': [1123, 3228, 3587, 5678, 6431]})
data = h2o.H2OFrame(df)

JaredDudley04
  • 123
  • 1
  • 1
  • 4

2 Answers2

25

There is an H2OFrame method called as_data_frame() but h2o.as_list() also works.

data_as_df = data.as_data_frame()
Erin LeDell
  • 8,704
  • 1
  • 19
  • 35
10

Convert h2o frame to List

data_as_list = h2o.as_list(data, use_pandas=False)

Convert h2o frame to pandas DataFrame. (Default use_pandas=True)

data_as_df = h2o.as_list(data)
nautograph
  • 254
  • 2
  • 10