rzellem / EXOTIC

EXOplanet Transit Interpretation Code
Other
77 stars 44 forks source link

pandas.Series.bool is deprecated since Pandas 2.1.0 #1254

Open IraLeeBell opened 2 months ago

IraLeeBell commented 2 months ago

Please see the following pandas document: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.bool.html

We currently use the following code in nea.py:

if nans[k].bool(): # if col value is nan

Need to update to the following for the above example:

if nans[k].iloc[0]:

...

Just creating this issue for now and will update/fix after I have a look to see if we're using the Series.bool anywhere else.

IraLeeBell commented 2 months ago

If anyone should tackle this before I get to it, please make sure to update the requirements.txt to a modern version of Pandas, such as 2.2.2. Ping me in Slack w/ any questions.

ivenzor commented 2 weeks ago

@IraLeeBell It seems this is the only part of the codebase where pandas.Series.bool is used. Would you like to replace if nans[k].bool() withif nans[k].any() instead of if nans[k].iloc[0] ?

Additionally, either modification should work with the older pandas version specified in the requirements. It's not mandatory to upgrade pandas due to this change. I assume you still want to upgrade to avoid using outdated packages?