问题
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.
回答1:
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'}
来源:https://stackoverflow.com/questions/43548878/h2o-python-how-to-get-variable-types-gettypes-equivalent