Python Forum
Converting cells in excel to JSON format
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting cells in excel to JSON format
#1
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.
Reply
#2
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.
Reply
#3
okie, let me give a try.

Is there any difference when converting to JSON Vs NDJSON format?
Reply
#4
Hi all,

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

Attached Files

.xlsx   dataframe.xlsx (Size: 10.1 KB / Downloads: 108)
Reply
#5
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  format json outputs ! evilcode1 3 1,758 Oct-29-2023, 01:30 PM
Last Post: omemoe277
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,510 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 1,888 Dec-12-2022, 08:22 PM
Last Post: jh67
  Convert Json to table format python_student 2 5,561 Sep-28-2022, 12:48 PM
Last Post: python_student
  How to format Excel column with comma? dee 0 1,375 Jun-13-2022, 10:11 PM
Last Post: dee
  json format Bubu93200 6 1,942 Apr-23-2022, 08:59 AM
Last Post: Bubu93200
  Openpyxl-change value of cells in column based on value that currently occupies cells phillipaj1391 5 9,863 Mar-30-2022, 11:05 PM
Last Post: Pedroski55
  Need Help writing data into Excel format ajitnayak87 8 2,544 Feb-04-2022, 03:00 AM
Last Post: Jeff_t
  Exporting dataframes to excel without loosing datetime format Rafa 0 1,240 Oct-27-2021, 10:42 AM
Last Post: Rafa
  Python “Formula” Package: How do I parse Excel formula with a range of cells? JaneTan 1 2,691 Jul-12-2021, 11:09 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020