Giter Club home page Giter Club logo

nb2xls's People

Contributors

danlester avatar katilp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nb2xls's Issues

Multiple outputs per code cell not supported

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))))

charts export size

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!

Pandas dataframes with NaN values

Issue Description

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

Reproducing

To reproduce the issue, simply create a notebook with the following cell and try to export:

pd.DataFrame([[pd.np.nan]])

IPython.display.Markdown - `_repr_*_()`

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.