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

Initializing with duplicate timestamp values #506

Open
CGenie opened this issue Mar 24, 2022 · 1 comment
Open

Initializing with duplicate timestamp values #506

CGenie opened this issue Mar 24, 2022 · 1 comment

Comments

@CGenie
Copy link

CGenie commented Mar 24, 2022

Hello,
I have this data:

    data = (
        timestamp=[Dates.DateTime(2022, 1, 1, 10, 0),
                   Dates.DateTime(2022, 1, 1, 10, 0)],
        col=[1, 2]
    )
    ta = TimeArray(data, timestamp=:timestamp)

As you see, the date is duplicated. Is there a way to "compress" this so that there is a single timestamp while the values is a list [1, 2]? Because currently it is treated as:

2×1 TimeArray{Int64, 2, DateTime, Matrix{Int64}} 2022-01-01T10:00:00 to 2022-01-01T10:00:00
│                     │ col   │
├─────────────────────┼───────┤
│ 2022-01-01T10:00:00 │ 1     │
│ 2022-01-01T10:00:00 │ 2     │
@ValentinKaisermayer
Copy link
Contributor

I think you would have to alter the data first but you can instantiate TimeArrays with anything as column type:

TimeSeries.TimeArray([Dates.DateTime(2022,01,01)],[[1,2]])

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

2 participants