Skip to content

Commit

Permalink
Added alternative for pandas2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewssobral committed Mar 13, 2024
1 parent e9bb81e commit 86004ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MachineLearning/resources/catalog/Utils_Script.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,12 @@ def export_dataframe_html(dataframe):
nrows = len(dataframe.index)
info = "Total of " + str(nrows) + " rows"
print(info)
with pd.option_context('display.max_colwidth', -1):
result = dataframe.to_html(escape=False, classes='table table-bordered table-striped', justify='center')
try:
with pd.option_context('display.max_colwidth', -1):
result = dataframe.to_html(escape=False, classes='table table-bordered table-striped', justify='center')
except:
with pd.option_context('display.max_colwidth', None):
result = dataframe.to_html(escape=False, classes='table table-bordered table-striped', justify='center')
result = """
<!DOCTYPE html>
<html>
Expand Down

0 comments on commit 86004ea

Please sign in to comment.