For example, I have created an Excel file named “records.xlsx”
My Excel Data
Car Name Price Count
Honda 100 1
Tata 150 10
GMR 200 5
And I am importing it like this
import excel2json
excel2json.convert_from_file('records.xlsx')
Which is converting my excel file to following JSON:
[
{
"Car Name": "Honda",
"Price": "100",
"Count": "1"
},
{
"Car Name": "Tata",
"Price": "150",
"Count": "10"
},
{
"Car Name": "GMR",
"Price": "150",
"Count": "5"
}
]
I don't want the Price
column in my resulting JSON. How can I convert this Excel file to JSON directly such that only columns Car Name
and Count
will appear in resulting JSON?