Convert tabular pdf data to a csv and also read it as a python dataframe
✓ Published0🌍 Public
Aabehmiel
Last edited Nov 1, 2017
Created on Nov 1, 2017
This example converts tabular PDF data into a clean CSV file and a pandas DataFrame. It reads a government PDF containing space-delimited user IDs and handles using `tabula.read_pdf` with `pages='all'`, then splits the single messy column into two properly named columns (`user id` and `handle`) via pandas string methods. The cleaned data is written to `exhibit_b.csv` using `df.to_csv`. The script demonstrates a practical workflow for fixing poorly formatted government tabular releases with pandas and tabula-py.
AI-generated description