问题
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