Skip to content

Commit

Permalink
Make compatible with pandas 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Aug 17, 2023
1 parent 22b7ff5 commit 40af557
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/open_petro_elastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")
Expand Down

0 comments on commit 40af557

Please sign in to comment.