You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the DummyValueImputation in the line where the NaN values are imputed. The current implementation calls np.where(np.isnan(values)) to get the indexes of the NaN values of the array.
(Paste the complete error message, including stack trace, or the undesired output that the above snippet produces.)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell 10 line 2
[1](vscode-notebook-cell:/home/example_notebook.ipynb#X32sZmlsZQ%3D%3D?line=0) nan_indices = np.where(np.isnan(values))
----> [2](vscode-notebook-cell:/home/example_notebook.ipynb#X32sZmlsZQ%3D%3D?line=1) values[nan_indices] = 0
TypeError: list indices must be integers or slices, not tuple
Environment
Operating system: Kubuntu 23.04
Python version: 3.11
GluonTS version: 0.14.0
(Add as much information about your environment as possible, e.g. dependencies versions.) No need to do that as it is a numpy related buug
The issue can be fixed by simply substituting line 80 with:
>>> nan_indices = np.isnan(values)
I did a quick fix and modified the file that I have on my machine, but I'll fork the repository and create a new branch from this issue now
The content you are editing has changed. Please copy your edits and refresh the page.
I realised that the problem is that the passed values were not arrays.... Im super sorry for this error, but I guess maybe it would be good to raise a TypeError when the passed argument is not an array
Description
There is a bug in the
DummyValueImputation
in the line where the NaN values are imputed. The current implementation callsnp.where(np.isnan(values))
to get the indexes of the NaN values of the array.The file is at https://github.com/awslabs/gluonts/blob/dev/src/gluonts/transform/feature.py and the line I am talking about is line 80
To Reproduce
There is no need to use
gluonts
to reproduce the issue, we can use numpy itself:Error message or code output
(Paste the complete error message, including stack trace, or the undesired output that the above snippet produces.)
Environment
(Add as much information about your environment as possible, e.g. dependencies versions.) No need to do that as it is a
numpy
related buugThe issue can be fixed by simply substituting line 80 with:
I did a quick fix and modified the file that I have on my machine, but I'll fork the repository and create a new branch from this issue now
Tasks
The text was updated successfully, but these errors were encountered: