问题描述
R中getTypes的Python等效项是什么?我正在尝试从H2O数据框中提取每个列的变量类型(枚举,字符串,整数等).
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.)
此外,有人可以广泛地给我发送一些文档的链接,该文档列出了Python数据框的所有属性和函数吗?像. df.nrow,df.shape等.我真的很难找到这样清晰的来源.
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.
推荐答案
您可以在此处获取有关H2O的Python API(特别是H2OFrame方法的文档)的文档: http://docs.h2o.ai/h2o/latest-stable/h2o-py/docs/frame.html
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
如果要在H2O Python中获取数据框的类型,请执行.types
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'}
这篇关于H2O Python-如何获取变量类型,等效于getTypes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!