-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved RAM usage between 30 - 50%, improved pandas.DataFrame to xls…
…x speed between 30 - 50%.
- Loading branch information
1 parent
8555377
commit 349f662
Showing
11 changed files
with
232 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
*.xlsx | ||
.DS_STORE | ||
__pycache__ | ||
profile.json | ||
profile.json | ||
*.so |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
from io import BytesIO | ||
|
||
import pandas as pd | ||
import numpy as np | ||
|
||
from py_excel_rs import _excel_rs | ||
|
||
def csv_to_xlsx(buf: bytes) -> bytes: | ||
return _excel_rs.export_to_xlsx(buf) | ||
|
||
def df_to_xlsx(df: pd.DataFrame) -> bytes: | ||
buf = BytesIO() | ||
df.to_csv(buf, index=False) | ||
|
||
buf.seek(0) | ||
return _excel_rs.export_to_xlsx(buf.read()) | ||
py_list = np.vstack((df.keys().to_numpy(), df.to_numpy(dtype='object'))) | ||
return _excel_rs.py_2d_to_xlsx(py_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.