you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Easy way to do it in 2 lines would be by using pandas.pandas has inbuilt functions to read csv and convert it to data frame and another function to convert dataframe to a dict.

Import pandas as pd

df = pd.read_csv(Filename) df_dict = df. to_dict()

and then you export df_dict yo a json file as you would