H2O Python - how to get variable types, getTypes equivalent

送分小仙女□ 提交于 2020-01-24 10:01:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!