当我运行我的代码时,我的代码 setindex! 发生了一个错误!没有为 WeakRefStrings.StringArray{String,1} 定义
CSV 文件 here .
using CSV
EVDdata =CSV.read(raw"wikipediaEVDdatesconverted.csv")
EVDdata[end-9:end,:]
错误代码是here
rows, cols = size(EVDdata)
for j =1:cols
for i = 1:rows
if !isdigit(string(EVDdata[i, j])[1])
EVDdata[i,j] = 0
end
end
end
我在 Jupter Notebook 上使用 Julia 1.4.1
最佳答案
setindex!(collection, item, inds...)
是 colection[inds...] = item
被降低到的函数。错误来自于 CSV.read
生成不可变集合这一事实。
关于coding-style - julia 中的 "setindex! not defined"错误是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61995125/