Skip to content

Instantly share code, notes, and snippets.

@tashrifbillah
Last active June 18, 2020 17:01
Show Gist options
  • Save tashrifbillah/5ec1d30bd8b6913db62d523193382bf3 to your computer and use it in GitHub Desktop.
Save tashrifbillah/5ec1d30bd8b6913db62d523193382bf3 to your computer and use it in GitHub Desktop.
OHBM Hackathon project of Dave and Nazek
import pandas as pd
import pdfkit
df=pd.DataFrame(columns= ['col 1', 'col 2'])
df.loc[0]=[1,2]
df.loc[1]=[3,4]
df.loc[3]=["2020-06-05 00:50:22.953896: E tensorflow/stream_executor/cuda/cuda_driver.cc:806] failed to allocate 225.53M (236486144 bytes) from device: CUDA_
ERROR_OUT_OF_MEMORY: out of memory", "predict_x = loaded_model.predict(x_test, verbose=1)"]
pd.set_option('display.max_colwidth', -1)
print(df)
df.to_html('~/abc.html')
# install pdfkit https://pypi.org/project/pdfkit/
# may need https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf as well
pdfkit.from_file('~/abc.html','~/abc.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment