From 4852d8d91fe54d31fe4c656bbb729a91f6062fde Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Tue, 10 May 2022 06:50:03 +0200 Subject: [PATCH] Support pandas versions < 1.1.0 --- inputs/distributions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inputs/distributions.py b/inputs/distributions.py index 3577eae..9bb60f8 100644 --- a/inputs/distributions.py +++ b/inputs/distributions.py @@ -38,13 +38,13 @@ df = pd.read_excel('IPCC AR6.xlsx', index_col=[0, 1, 2, 3, 4]) df = df.sort_index() dff = df.loc[838, 'total', 'medium', 'ssp585'].T dff.index.name = 'year' -percentiles = dff.columns.to_numpy() / 100 +percentiles = dff.columns.values / 100 # Make SLR relative to 2020 level (at the 50th percentile) dff -= dff.loc[2020, 50] for i, row in dff.iterrows(): - values = row.to_numpy() + values = row.values # Fit normal distribution loc, scale = optimize.curve_fit(norm_cdf, values, percentiles)[0]