3 ms·
If it was just that, I'd probably load onto a pandas df, then export the df to json. There's other ways, but this would be a simple enough way. Check, - https
by rovr138 2y ago
If it was just that, I'd probably load onto a pandas df, then export the df to json. There's other ways, but this would be a simple enough way.
Check,
- https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html https://pandas.pydata.org/pandas-docs/stable/reference/api/p...
- https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_json.html https://pandas.pydata.org/pandas-docs/stable/reference/api/p...
Try something like,
import pandas as pd
file_path = 'excel_file.xlsx'
df = pd.read_excel(file_path, sheet_name='WORKSHEET NAME')
df.to_json('output.json', orient='records', indent=4)