Can anyone please explain why the below outputs no data? The Results.html
is not produced.
df = pd.read_csv(os.path.join(root,filename), skip_blank_lines=True)
df.dropna(how="all", inplace=True)
data = df.sort(ascending=True)
HTML('''<style>.white_space_df td { white-space: normal; }</style>''')
HTML(data.to_html(os.path.join(root, "Results.html"), index=False, na_rep="NA", classes='white_space_df'))
Update
I was able to work out the issue myself, just encase anyone else comes across this below is the working example.
df = pd.read_csv(os.path.join(root,filename), skip_blank_lines=True)
df.dropna(how="all", inplace=True)
data = df.sort(ascending=True)
style = '''<style>.white_space_df td { word-wrap: break-word; }</style>'''
style + data.to_html(os.path.join(root, "Results.html"), index=False, na_rep="NA", classes='white_space_df')