5

What is the Python equivalent of getTypes in R? I'm trying to extract the variable types for each column from H2O data frame (enum, string, int etc.)

Also, broadly can someone send me a link to some documentation listing all the properties and functions for data frames for Python? Things like. df.nrow, df.shape etc. I have really hard time finding such clear source.

C8H10N4O2
  • 18,312
  • 8
  • 98
  • 134
thasainta
  • 93
  • 1
  • 5
  • Did you try googling "pandas documentation?" You should know that questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow. – juanpa.arrivillaga Apr 21 '17 at 17:45
  • Appreciate the response but to be clear, I'm looking for native H2O module method for getting the variable type, which clearly is easily displayed in Flow. I don't want to use Pandas, Coalas etc - they are good but I feel are workarounds. – thasainta Apr 21 '17 at 19:36

1 Answers1

13

You can get the documentation for H2O's Python API (specifically for H2OFrame methods) here: http://docs.h2o.ai/h2o/latest-stable/h2o-py/docs/frame.html

If you want to get the types of a dataframe in H2O Python do .types

frame = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/iris/iris.csv")
frame.types
{u'C3': u'real', u'C2': u'real', u'C1': u'real', u'C5': u'enum', u'C4': u'real'}
Lauren
  • 5,640
  • 1
  • 13
  • 19