Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Your Own Data #130

Open
dsambor10 opened this issue Jun 5, 2020 · 6 comments
Open

Import Your Own Data #130

dsambor10 opened this issue Jun 5, 2020 · 6 comments

Comments

@dsambor10
Copy link

Hi,
I tried importing my data via your instructions and when I run these lines:

my_path=joinpath(homedir(),"Documents","tutorial","TimeClustInput.csv")
your_data_1=load_timeseries_data(my_path; region="none", T=24)

I get this error:
LoadError: MethodError: objects of type Bool are not callable

Sorry for the basic question!
Dan

@YoungFaithful
Copy link
Collaborator

Hi @dsambor10, I suppose your TimeClustInput.csv contains true and false, is that correct?

@dsambor10
Copy link
Author

That's the confusing aspect, it does not. Is there a proper timestamp format that is required? Here's a snapshot of my data:
image

@YoungFaithful
Copy link
Collaborator

Your timestamp column looks all right. However you need to add a column called Year. (That is due to the fact, that the timestamp is not really interpretated)
https://holgerteichgraeber.github.io/TimeSeriesClustering.jl/stable/load_data/#Load-your-own-data-1

@dsambor10
Copy link
Author

Thanks for clarifying. I discovered the issue was that I had not specified in loading time series that "years=[2019]" because the doc said that's optional to designate and I thought it would read the year, but it's required to have I guess. It all works now.
PS Is there any means of exporting the .clust_data (e.g. to a csv) once it's been clustered?

@holgerteichgraeber
Copy link
Owner

holgerteichgraeber commented Jun 16, 2020

I don't think we have a function for that. Should be pretty simple to implement though:

using DataFrames

for (k,v) in X.clust_data.data  
  name = "$k"
  CSV.write(name*".csv", DataFrame(v))
end

clust_data is of type ClustData, and .data is a dictionary, see https://github.com/holgerteichgraeber/TimeSeriesClustering.jl/blob/master/src/utils/datastructs.jl

You may need to play with the settings of DataFrame and CSV.write, but this should give a general idea.

This will write one csv for each data type.

@dsambor10
Copy link
Author

I'm getting the same error that I and others have gotten in the past "objects of type Bool are not callable" (as per screenshot below) when I try to load my time series data (screenshot) below. It was working before but now appears to be an issue again. I've designated a year column and all my paths are correct. I'm loading my data with:

ts_input_data = load_timeseries_data("/home/dsambor/DanDocs/KLRS/Clust"; T=24,years=[2021])

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants