Skip to content

Commit

Permalink
Limit the number of displayed number of significant numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharras committed Oct 18, 2023
1 parent a0d3e57 commit 6eee41c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion benchmarks/kmeans/consolidate_result_csv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import hashlib
from functools import partial
from io import BytesIO
from itertools import zip_longest
from operator import attrgetter
Expand Down Expand Up @@ -348,7 +349,24 @@ def _sanitize_df_with_tocsv(df):


def _df_to_csv(df, target):
df.to_csv(target, index=False, mode="a", date_format=DATES_FORMAT)
float_format_fn = partial(
np.format_float_positional,
precision=3,
unique=True,
fractional=False,
trim="-",
sign=False,
pad_left=None,
pad_right=None,
min_digits=None,
)
df.to_csv(
target,
index=False,
mode="a",
float_format=float_format_fn,
date_format=DATES_FORMAT,
)


def _gspread_sync(source, gspread_url, gspread_auth_key):
Expand Down

0 comments on commit 6eee41c

Please sign in to comment.