<#C031EJJMH46|> Hey everyone I'm using nixtla mlfo...
# general
s
#C031EJJMH46 Hey everyone I'm using nixtla mlforecasts. And I'm doing a preprocess of the data to add the variables needed. But for some reason I'm having this error. I kinda understand what's happening but I'm not sure how to fix it cause it's an error inside the preprocess function of nixtla:
j
Hey. Can you provide the code that you're running?
s
Sure, it's pretty straightforward You can assume that the dataframe we are passing to preprocess is of the form: ds, y, unique_id ds is a datetime field y is a numeric field unique_id is a string field So I check if I haven't had a problem doing the clearing in the dataframe to fit that form. That's not the case, I'm adding little extra screenshot of the data inside categories[cat]
There's also extra functions for the features. These functions just returns a categorical vector to see if I'm in a seasonal period. I'm adding one example here:
j
Is there any date feature function that returns a list?
We recently changed this process to be more efficient so we only compute the date features for the unique dates and then kind of upsample it back using a pandas series to index the result. If your function doesn't return a pandas series it could cause that error I think
s
Oh yes, I have one doing that:
j
Can you try just doing
return pd.Series(result)
?
s
Oh makes sense, I will change that function to return pandas series instead. Actually that was working on a past version of the library. That error is happening on an updated version.
Sure, I will come back when I try it. Thanks in advance José!
🙌 1
I works! That was the problem. I change it to return a pandas series an run without hassle. Thank you very much José!
🙌 1