Skip to content

Commit

Permalink
Use 2 decimal points for Cost, rounding up
Browse files Browse the repository at this point in the history
Switches the precision of Cost from 3 to 2. The value is rounded
up as demontrated by the following block of code given the following
csv file.

```csv
Cost
123.1234
123.5678
```

```python
>>> dataframe = pandas.read_csv("csv.csv", dtype={"Cost": pandas.ArrowDtype(pyarrow.decimal128(12, 2))})
>>> dataframe
     Cost
0  123.12
1  123.57
```

Related #35
  • Loading branch information
knikolla committed May 1, 2024
1 parent 8ac8cca commit 9f999e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process_report/process_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def merge_csv(files):
dataframes = []
for file in files:
dataframe = pandas.read_csv(
file, dtype={COST_FIELD: pandas.ArrowDtype(pyarrow.decimal128(12, 3))}
file, dtype={COST_FIELD: pandas.ArrowDtype(pyarrow.decimal128(12, 2))}
)
dataframes.append(dataframe)

Expand Down

0 comments on commit 9f999e5

Please sign in to comment.