Theil Sen estimator for 3D array in Python

I have a 3D grid in which the axis are x (longitude), y (latitude), and years. I want to produce Theil-Sen temporal trends over all grid cells. In the documentation and in the related stackoverflow questions the regression is always being performed over dataframes. Is it possible to do the regression on a 3D numpy array, or do I need to change the structure to a 2D array or pandas dataframe.

Documentation Theil-Sen estimator: https://scikit-learn.org/stable/auto_examples/linear_model/plot_theilsen.html

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.