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

IndexError when datetime is used with hour != 0 #50

Open
oceanites opened this issue Jan 2, 2023 · 0 comments
Open

IndexError when datetime is used with hour != 0 #50

oceanites opened this issue Jan 2, 2023 · 0 comments

Comments

@oceanites
Copy link

Whenever one of the dates fed to model.fit() has the hour or minute set to something else then 0, the error
IndexError: boolean index did not match indexed array along dimension 1; dimension is 151 but corresponding boolean dimension is 152 is thrown.

This works also for the example code, when one value is modified like:

i = 34
di = dates_example[i]
dates_example[i] = datetime(di.year, di.month, di.day, 0, 34)

The error occurs in map_indices

def map_indices(dates):

where an empty array with shape (0, ) is returned, because ~np.isnan(ts).to_numpy() is False for every element.

A fix workaround for me is to use date instead of datetime objects.
I can also try to come up with a better fix, but that would need some time.

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

1 participant