CSV (or Comma Separated Value) files represent data in a tabular format, with several rows and columns. An example of a CSV file can be an Excel Spreadsheet. These files have the extension of .csv, for instance, geeksforgeeks.csv. In this sample file, every row will represent a record of the dataset, and each column will indicate a unique feature variable.
Refer to the below articles to understand the basics of JSON and CSV.
Converting CSV to JSON
Wewill create a JSON file that will have several dictionaries, each representing a record (row) from the CSV file, with the Key as the column specified.
Sample CSV File used:
- Convert JSON to CSV in Python
- Python program to read CSV without CSV module
- Saving Text, JSON, and CSV to a File in Python
- Python - Difference between json.dump() and json.dumps()
- Convert CSV to Excel using Pandas in Python
- Create a GUI to convert CSV file into excel file using Python
- How to Convert an image to NumPy array and saveit to CSV file using Python?
- Convert Text File to CSV using Python Pandas
- Convert CSV to HTML Table in Python
- Convert HTML table into CSV file in python
- Convert Excel to CSV in Python
- Convert a NumPy array into a csv file
- Python | Ways to convert string to json object
- Convert JSON to dictionary in Python
- Convert Text file to JSON in Python
- Python - Convert JSON to string
- How To Convert Python Dictionary To JSON?
- How to convert pandas DataFrame into JSON in Python?
- Convert JSON data Into a Custom Python Object
- Python | Read csv using pandas.read_csv()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.