From b4a331d8e7c254bc5135d87afa8095139fb9423e Mon Sep 17 00:00:00 2001 From: sdementen Date: Fri, 15 Mar 2024 13:49:48 +0100 Subject: [PATCH] fix #52 specify a newline="\n" to ensure that on windows the csv has not "\r\n" as otherwise pivottable will see rows with null values --- pivottablejs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pivottablejs/__init__.py b/pivottablejs/__init__.py index baf3b07..48fd955 100644 --- a/pivottablejs/__init__.py +++ b/pivottablejs/__init__.py @@ -70,7 +70,7 @@ def pivot_ui(df, outfile_path = "pivottablejs.html", url="", width="100%", height="500", **kwargs): - with io.open(outfile_path, 'wt', encoding='utf8') as outfile: + with io.open(outfile_path, 'wt', newline="\n", encoding='utf8') as outfile: csv = df.to_csv(encoding='utf8') if hasattr(csv, 'decode'): csv = csv.decode('utf8')