holgerteichgraeber / TimeSeriesClustering.jl

Julia implementation of unsupervised learning methods for time series datasets. It provides functionality for clustering and aggregating, detecting motifs, and quantifying similarity between time series datasets.
MIT License
82 stars 23 forks source link

A question about TimeSeriesClustering.jl #131

Open 1256ABCDE opened 4 years ago

1256ABCDE commented 4 years ago

image `using TimeSeriesClustering

ts_input_data = load_timeseries_data("D:\mycode\code\。。。。.csv"; T=24, years=[2016]) ` ERROR: LoadError: MethodError: objects of type Bool are not callable Stacktrace: [1] find_column_name(::DataFrames.DataFrame, ::Array{Symbol,1}; error::Bool) at C:\Users\dadou.juliapro\JuliaPro_v1.4.2-1\packages\TimeSeriesClustering\3T6SG\src\utils\load_data.jl:161 [2] find_column_name at C:\Users\dadou.juliapro\JuliaPro_v1.4.2-1\packages\TimeSeriesClustering\3T6SG\src\utils\load_data.jl:153 [inlined] [3] add_timeseries_data!(::Dict{String,Array}, ::SubString{String}, ::DataFrames.DataFrame; K::Int64, T::Int64, years::Array{Int64,1}) at C:\Users\dadou.juliapro\JuliaPro_v1.4.2-1\packages\TimeSeriesClustering\3T6SG\src\utils\load_data.jl:131 [4] add_timeseries_data!(::Dict{String,Array}, ::SubString{String}, ::String; K::Int64, T::Int64, years::Array{Int64,1}) at C:\Users\dadou.juliapro\JuliaPro_v1.4.2-1\packages\TimeSeriesClustering\3T6SG\src\utils\load_data.jl:116 [5] load_timeseries_data(::String; region::String, T::Int64, years::Array{Int64,1}, att::Array{String,1}) at C:\Users\dadou.juliapro\JuliaPro_v1.4.2-1\packages\TimeSeriesClustering\3T6SG\src\utils\load_data.jl:50 [6] top-level scope at D:\mycode\code\测试.jl:3 in expression starting at D:\mycode\code\测试.jl:3

I’m running the example on the official website. Why did I get an error?thanks!!!

holgerteichgraeber commented 3 years ago

Something in the path of the csv does not look correct, you may want to check if this is the true filename of the csv. (the four dots)

jookty commented 3 years ago

I am using julia v.1.5.3 and I had same problem. And I found that 130 and 131 lines in load_data.jl are time_name=find_column_name(data, [:Timestamp, :timestamp, :Time, :time, :Zeit, :zeit, :Date, :date, :Datum, :datum]; error=false) year_name=find_column_name(data, [:year, :Year, :jahr, :Jahr])

and 154~155 lines are +++++++++++++++++++ for name in name_itr if name in names(df) col_name=name break end end ++++++++++++++++++++++ therefore col_name is always :none

+++++++++++++++++++++++++++++++++++++++++++ solutions : I can fix like that if name in names(df) -> if name in Symbol.(names(df)) +++++++++++++++++++++++++++++++++++++++++++

YoungFaithful commented 3 years ago

@jookty, could you create a merge request with your solution?

Xinhe-Chen commented 2 years ago

Hi, I have the same problem. This is my Julia version.

Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: AMD Ryzen 7 5800H with Radeon Graphics WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, znver3)

I tried the suggestions that @jookty offered. It almost worked. But I have another problem follows

WARNING: both StatsBase and Distances export "pairwise"; uses of it in module Clustering must be qualified

It seems a confliction between Distances packages and StatsBase. It has been solved after I degraded the Distances version to 0.7.0.