Closed stvilla closed 3 years ago
Thank you @stvilla. I think this must be related to https://github.com/openeemeter/eemeter/pull/408, having to do with pandas version API changes. I'll go ahead and close this issue once we've got that resolved.
Perfect @philngo. Thank you
On Padas docs, if the parameter for the .dot
operation is a Series, it'll return a Series.
If other is a Series, return the matrix product between self and other as a Series. If other is a DataFrame or a numpy.array, return the matrix product of self and other in a DataFrame of a np.array.
This is the code where the rename
method returns an error.
https://github.com/openeemeter/eemeter/blob/ea42fe081f4677351293e49ae1307edf6f527b3b/eemeter/segmentation.py#L96-L99
And this is the line where the parameter is created. https://github.com/openeemeter/eemeter/blob/ea42fe081f4677351293e49ae1307edf6f527b3b/eemeter/segmentation.py#L75
The parameter is created as a Series, so the result will also be a Series. In this case the rename
method should have only one positional parameter with the name. It should be something like this:
# Step 3, predict
prediction = design_matrix_granular.dot(parameters).rename("predicted_usage")
I've done this change and my code worked. Only issue is that I'm not sure if the result is what was intended before when the code used to work.
Letting you know @stvilla and @jpvelez that we merged in the PR and the newest eemeter version should now work with the new pandas!
Thank you!
Hi,
trying to reproduce the hourly example found here, I get the following error:
The problem seems to be that the rename command is called on a Pandas series instead of a Pandas Dataframe with the keyword argument "columns"
Report installed package versions
Minimal example
Thank you!