Problem with sktime data when using Google Colab, but not when running the same code in a local Jupyter notebook. #6415
-
Hello, I want to share the results of processing some data using sktime with a colleague of mine using Google Colab. The Jupyter notebook on my local machine runs smoothly without any glitches. However, when I try to run it on Google Colab, I encounter an error. Here is the piece of code where things go wrong:
When I issue sktime.datatypes.check_raise(X_train, 'nested_univ') on the local jupyter notebook, python returns True. Unfortunately that is not the answer when issuing the same command on the google colab notebook. TypeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/sktime/datatypes/_check.py in check_raise(obj, mtype, scitype, var_name) TypeError: input entries must be pd.Series What am I missing? Many thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That's really hard to tell without the actual code. A general comment I can add on this, the We therefore recommend to avoid the For instance, the line Would different You can show |
Beta Was this translation helpful? Give feedback.
That's really hard to tell without the actual code.
A general comment I can add on this, the
nested_univ
datatype - the nested data container - is becoming increasingly glitchy and unstable across environment configurations and operating systems since pandas 2, due to changes in how nested structures are handled, and lack of official support.We therefore recommend to avoid the
nested_univ
data container specification where possible, and instead work withnumpy3D
orpd-multiindex
specifications.For instance, the line
X_nested.iloc[i, 0] = pd.Series(df[which_var].iloc[i:i+window_size].values)
works on somepandas
versions, but I think it does not work the same on newer ones, as the behavi…