A question about data type


my data is not empty,but it always "missing ",so my initseeds function does not work.
thanks!

using CSV,Clustering,Gadfly
data=CSV.read("D:\\数据\\数据.csv")
load=convert(Array,data[90001:120000,5])
solar=convert(Array,data[90001:120000,8])
wind=convert(Array,data[90001:120000,9])
Dload=reshape(load,24,:)
Dsolar=reshape(solar,24,:)
Dwind=reshape(wind,24,:)
Dlsw=[Dload;Dsolar;Dwind]
#D-Resl=reshape(RESL,24,:)
#initseeds(:rand,convert(Matrix,Dlsw),12)
#result=kmeans(Dlsw',12)
#Gadfly.plot(data,)

This is hard to answer without a minimum working example. Are you saying that the data you read in from csv is always missing? Or that the resulting columns of your DataFrame are Union{T, Missing}?

If this is just an issue of passing the correct type to a function you can narrow the type of your columns by doing disallowmissing!(data), but this will only work if there are no actual missing values in the data. If you do have missing I suppose the best way of proceeding depends on your actual use case!?

1 Like