Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

methods don't work with Pandas DataFrame #39

Open
raoulcollenteur opened this issue Nov 23, 2022 · 2 comments
Open

methods don't work with Pandas DataFrame #39

raoulcollenteur opened this issue Nov 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@raoulcollenteur
Copy link
Member

I think the methods are not tested for pandas.DataFrame, and actually don't work for this data yet. Running the following code with dataframes gives an error:

et = pyet.hargreaves(tmean, tmax, tmin, lat=lat)

TypeError: 'str' object is not callable

I think caused by this line:

--> 192 return pe.rename("Hargreaves")

@mvremec
Copy link
Contributor

mvremec commented Nov 26, 2022

At this point, PyEt is working only with Pandas.Series and xarray.DataArray.
We do not state anywhere that you can also use pandas.DataFrame.
We can think about extending PyEt to DataFrames, however, there are some challenges in doing so:

  1. rename function works with pandas.Series and xarray.DataArray, but not with pandas.DataFrame.
  2. NumPy functions (max, min, mean, ...) used on pandas.Series and xarray.DataArray return a Float/Int. With pandas.DataFrame, they return a pandas.Series.

In short, I can not think of a simple and fast solution so that PyEt also works with pandas.DataFrames.

@raoulcollenteur
Copy link
Member Author

Note to self, document use of Pandas Apply function in the examples to do this.

@raoulcollenteur raoulcollenteur added this to the 1.3: PyEt Reloaded milestone Dec 6, 2023
@raoulcollenteur raoulcollenteur added bug Something isn't working documentation Improvements or additions to documentation labels Dec 6, 2023
@raoulcollenteur raoulcollenteur self-assigned this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants