Skip to content

Commit

Permalink
MAINT: implement pandas iloc
Browse files Browse the repository at this point in the history
Implement pandas iloc to address FutureWarnings.
  • Loading branch information
aburrell committed Aug 13, 2024
1 parent c13247c commit 06369e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pysatSpaceWeather/instruments/ace_sis.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def clean(self):

# Evaluate the different proton fluxes. Replace bad values with NaN and
# times with no valid data
self.data['int_pflux_10MeV'][self.data['status_10'] > max_status] = np.nan
self.data['int_pflux_30MeV'][self.data['status_30'] > max_status] = np.nan
self.data['int_pflux_10MeV'] = self.data['int_pflux_10MeV'].where(
(self.data['status_10'] <= max_status), other=np.nan)
self.data['int_pflux_30MeV'] = self.data['int_pflux_30MeV'].where(
(self.data['status_30'] <= max_status), other=np.nan)

eval_cols = ['int_pflux_10MeV', 'int_pflux_30MeV']

Expand Down
2 changes: 1 addition & 1 deletion pysatSpaceWeather/tests/test_methods_kp.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_convert_ap_to_kp_middle(self):
"""Test conversion of ap to Kp where ap is not an exact Kp value."""

kp_ap.convert_3hr_kp_to_ap(self.testInst)
new_val = self.testInst['3hr_ap'][8] + 1
new_val = self.testInst['3hr_ap']iloc[8] + 1
self.testInst.data.at[self.testInst.index[8], '3hr_ap'] = new_val
kp_out, kp_meta = kp_ap.convert_ap_to_kp(self.testInst['3hr_ap'])

Expand Down

0 comments on commit 06369e6

Please sign in to comment.