ideonate / nb2xls Goto Github PK
View Code? Open in Web Editor NEWConvert Jupyter notebook to Excel spreadsheet
License: MIT License
Convert Jupyter notebook to Excel spreadsheet
License: MIT License
Thanks again for your fixes and quick response times.
I found another issue, this time related to multiple outputs, especially outputs of different mime types per cell.
The following could should display 5 headings and 5 tables. The xls sheet however only shows the latest table, and no headings:
import pandas as pd
from IPython.display import *
for i in range(5):
display(Markdown(f'# Markdown Loop {i}'))
display(pd.DataFrame(pd.np.random.random((5,5))))
Cool extension. You might consider adding this and the other container DS Jupyter projects to awesome-jupyter, awesome-jupyterlab?
https://github.com/mauhai/awesome-jupyterlab
https://github.com/adebar/awesome-jupyter
https://github.com/quobit/awesome-python-in-education#jupyter
Is there any way to export the charts in a larger size in excel. I am able to use the package on all my notebooks but chart export size seems too small and I have to manually increase each chart size in excel. Please let me know if I missed anything?
Thanks for your work on this, its great!
The export function fails when there are pandas dataframes with NaN values.
The following message is displayed:
nbconvert failed: NAN/INF not supported in write_number() without 'nan_inf_to_errors' Workbook() option
To reproduce the issue, simply create a notebook with the following cell and try to export:
pd.DataFrame([[pd.np.nan]])
Found another one ๐
from IPython.display import Markdown, display
display(Markdown('''
# Hi Dan
1. Thanks for fixing the last issue so quickly
1. This library is really cool
1. I'll probably start using it for work soon
'''))
results in:
<IPython.core.display.Markdown object>
The same issue occurs without the display
. Similarly, IPython.display.HTML
and Latex
fail. I suspect you might need an explicit resolution of _repr_*_()
functions, as it's done in IPython
itself: IPython docs and the corresponding code (check the display
function)
Note: Somewhat surprisingly (to me, anyway), the following contrived example of a custom object displayed correctly:
from random import choice
from string import ascii_lowercase
def _random_str(length: int):
return ''.join(choice(ascii_lowercase) for _ in range(length))
class RandomUser:
def __init__(self):
self.user = _random_str(10)
self.password = _random_str(20)
def _repr_html_(self):
return f'''
<table>
<tr><th>User: </th><td>{self.user}</td>
<tr><th>Password: </th><td>{self.password}</td>
</table>
'''
RandomUser()
On the other hand, this code:
import json
class DisplayDict(dict):
def _repr_json_(self):
return self
DisplayDict({'hello': 'world'})
results in another error:
nbconvert failed: split
e.g.:
pd.DataFrame([['a',1,123], ['a',2,345], ['b',1,678], ['a',1,345]]).set_index([0,1])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.