-
Notifications
You must be signed in to change notification settings - Fork 367
DataFrame.to_excel #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataFrame.to_excel #288
Changes from 5 commits
986d03d
af070b8
9d5240c
97229a7
3c88eee
20934bb
6fea642
b45fc64
9738993
c8e073b
c88bbbe
35cd1de
c89137a
04603c2
fc14684
1c8a4dc
fe41e0e
fb2b0b2
70d6b0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,3 +70,34 @@ def test_to_html(self): | |
| """) | ||
| got = self.strip_all_whitespace(self.kdf.to_html(max_rows=2)) | ||
| self.assert_eq(got, expected) | ||
|
|
||
| def test_to_excel(self): | ||
| pdf = self.pdf | ||
| kdf = self.kdf | ||
| excel_writer = "output.xlsx" | ||
|
|
||
| self.assert_eq(kdf.to_excel(excel_writer), pdf.to_excel(excel_writer)) | ||
|
||
|
|
||
| pdf = pd.DataFrame({ | ||
| 'a': [1, None, 3], | ||
| 'b': ["one", "two", None], | ||
| }, index=[0, 1, 3]) | ||
|
|
||
| kdf = koalas.from_pandas(pdf) | ||
|
|
||
| self.assert_eq(kdf.to_excel(excel_writer, na_rep='null'), | ||
| pdf.to_excel(excel_writer, na_rep='null')) | ||
|
|
||
| pdf = pd.DataFrame({ | ||
| 'a': [1.0, 2.0, 3.0], | ||
| 'b': [4.0, 5.0, 6.0], | ||
| }, index=[0, 1, 3]) | ||
|
|
||
| kdf = koalas.from_pandas(pdf) | ||
|
|
||
| self.assert_eq(kdf.to_excel(excel_writer, float_format='%.1f'), | ||
| pdf.to_excel(excel_writer, float_format='%.1f')) | ||
| self.assert_eq(kdf.to_excel(excel_writer, header=False), | ||
| pdf.to_excel(excel_writer, header=False)) | ||
| self.assert_eq(kdf.to_excel(excel_writer, index=False), | ||
| pdf.to_excel(excel_writer, index=False)) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,3 +124,4 @@ Serialization / IO / Conversion | |
| DataFrame.to_spark | ||
| DataFrame.to_string | ||
| DataFrame.to_dict | ||
| DataFrame.to_excel | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| pandas>=0.23 | ||
| pyarrow>=0.10,<0.11 | ||
| numpy>=1.14 | ||
| openpyxl>=2.6.2 | ||
|
|
||
| # Documentation build | ||
| sphinx | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.