Skip to content
Permalink
Browse files

replace None by empty string in df2rst

  • Loading branch information...
sdpython committed Aug 2, 2015
1 parent ef92b18 commit 42a45b07b731ac32c30f3dbdf2dfc58816d3c86e
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/pyquickhelper/pandashelper/tblformat.py
@@ -24,13 +24,15 @@ def len_modified(s):
def df2rst(df, add_line=True, align=None):
"""
builds a string in RST format from a dataframe
@param df dataframe
@param add_line (bool) add a line separator between each row
@param align a string in [l,r,c,p{5cm}] or a list of the same,
or something like ``['1x','2x','5x']`` to specify a ratio
between column (alignment is left)
@return string
None values are replaced by empty string (4 spaces).
It produces the following results:
@code
@@ -101,6 +103,8 @@ def df2rst(df, add_line=True, align=None):

def complete(cool):
s, i = cool
if s is None:
s = " "
s = str(s) + " "
i -= 2
if len_modified(s) < i:

0 comments on commit 42a45b0

Please sign in to comment.
You can’t perform that action at this time.