Converting docx to pdf using libreoffice and pandas binning
Converting docx to pdf using libreoffice import subprocess, docx, time # first do: pip install python-docx t0 = time.time() subprocess.call(r'C:\Program Files\LibreOffice\program\soffice.exe --headless --convert-to pdf summary.docx --outdir . --nocrashreport --nodefault --nofirststartwizard --nolockcheck --nologo --norestore"') print('PDF generated in %.1f sec' % (time.time()-t0)) Pandas binning df.loc[df['score'].between(0, 50, 'both'), 'grade'] = 'C' df.loc[df['score'].between(50, 80, 'right'), 'grade'] = 'B' df.loc[df['score'].between(80, 100, 'right'), 'grade'] = 'A' https://towardsdatascience.com/how-to-bin-numerical-data-with-pandas-fe5146c9dc55 labels = ["low", "medium low", "medium", "medium high", "high"] df["binned alcohol"] = pd.qcut(df['alcohol'], q=5, labels=labels) df.groupby(&