From 40af557b42031e7f756580d104af5abd73cae258 Mon Sep 17 00:00:00 2001 From: Eivind Jahren Date: Thu, 17 Aug 2023 14:59:11 +0200 Subject: [PATCH] Make compatible with pandas 2.0 --- src/open_petro_elastic/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/open_petro_elastic/__main__.py b/src/open_petro_elastic/__main__.py index f2c7d62..6b42834 100644 --- a/src/open_petro_elastic/__main__.py +++ b/src/open_petro_elastic/__main__.py @@ -179,13 +179,13 @@ def run_with_threshold(args): return -5 inputs = make_per_row_input(args.config_file, args.data_file) num_failures = 0 - results = pd.DataFrame() + results = [] for idx, inp in enumerate(inputs): if inp is None: num_failures += 1 continue try: - results = results.append(calculate_results(inp)) + results.append(calculate_results(inp)) except Exception as e: print(f"Encountered error while calculating rows {id}: {e}") num_failures += 1 @@ -199,6 +199,7 @@ def run_with_threshold(args): ) return -5 try: + results = pd.concat(results) results.to_csv(args.output_file) except Exception as e: print(f"Encountered unexpected error while writing output: {e}")