Python Forum
Converting cells in excel to JSON format - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Converting cells in excel to JSON format (/thread-37259.html)



Converting cells in excel to JSON format - desmondtay - May-19-2022

Hi,

I am new to Python, need some help from the experts. I need to convert certain cells in 2 worksheets in excel to JSON format. How can i do it using Python. Any good advises? Thanks.


RE: Converting cells in excel to JSON format - snippsat - May-19-2022

The easiest way is to use Pandas read in read_excel and use to_json.
Give it try(search many example out there),post back if problems.


RE: Converting cells in excel to JSON format - desmondtay - May-20-2022

okie, let me give a try.

Is there any difference when converting to JSON Vs NDJSON format?


RE: Converting cells in excel to JSON format - desmondtay - May-23-2022

Hi all,

attached is the dataframe that i had managed to read out. Any idea how can I write into ndjson file?


RE: Converting cells in excel to JSON format - Larz60+ - May-23-2022

There are several packages available here: https://pypi.org/search/?q=ndjson
see (for example -- which I have never used): https://stackoverflow.com/a/51301673