我正在寻找一种修改DataArray级别的方法:
result = pool(["a", "a", "b"])
levels(result) = ["A", "B"]
答案 0 :(得分:1)
作为一种快速而肮脏的解决方案,您可以更改对象的pool
字段 - 它恰好是可变的。
result.pool = [ "A", "B" ]
result
# 3-element PooledDataArray{ASCIIString,Uint8,1}:
# "A"
# "A"
# "B"
xdump( result )
# PooledDataArray{ASCIIString,Uint8,1}
# refs: Array(Uint8,(3,)) Uint8[0x01,0x01,0x02]
# pool: Array(ASCIIString,(2,)) ASCIIString["a","b"]