as.h2o produces additional row when column names contain special characters

偶尔善良 提交于 2019-12-11 01:46:06

问题


I have a matrix containing non-ascii character in a column name:

df <- replicate(3, rnorm(5)) 
colnames(df) <- c('A', 'B', 'Č')
df

              A          B          Č
[1,]  1.6882234 0.37369538  0.1412783
[2,] -1.4538027 0.37603834 -0.2108820
[3,]  0.2878318 0.52661834 -0.4106152
[4,]  1.0373949 1.41206911  0.5056488
[5,] -2.3852925 0.05160573 -1.1288920

When I run the following, the result has one additional row and column name changes:

library(h2o)
h2o.init()
df_h2o <- as.h2o(df)
df_h2o

           A          B    "ÄŹĹĽËť
1        NaN        NaN        NaN
2  1.6882234 0.37369538  0.1412783
3 -1.4538027 0.37603834 -0.2108820
4  0.2878318 0.52661834 -0.4106152
5  1.0373949 1.41206911  0.5056488
6 -2.3852925 0.05160573 -1.1288920

[6 rows x 3 columns] 

Is there an elegant way to fix this besides fixing input column names?


回答1:


I was able to replicate this in 3.16.0.2; it's a bug (at least on some systems). You can follow the progress here. Thanks!



来源:https://stackoverflow.com/questions/48463961/as-h2o-produces-additional-row-when-column-names-contain-special-characters

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