CSV To JSON With Python Pandas

preview_player
Показать описание
#pandas, #python,

Step by step guide on how to read in a csv file that is comma separated and convert it to a json file. I also cover how to convert a csv file with compression I walk through the various parameters in the to_json method that you should be looking out for when writing your data. Finally, this video ends with how to read back a json file into python with pandas and without.

timestamps

00:00 introduction
00:20 read csv file
02:38 convert pandas dataframe to json
04:44 convert pandas dataframe to compressed json
05:48 read json with pandas
06:25 read compressed gzip in python
Рекомендации по теме
Комментарии
Автор

Bro you nailed it specially converting df to json and passing indent and Orient inside to json method.. I was stuck bec my json was reading the row indexes as well and I am new to python this helped me to make a very neat json. Subscribed to the channel keep doing the good work

karanjugran
Автор

you can put the r'f:\ code inside
df = pd.read_csv(r'f:\ etc) for example no need for two lines of code

texasfossilguy
Автор

Hey, I'm getting this erro while converting to json please tell!

TypeError: to_json() got an unexpected keyword argument 'indent'

umaralisiddiqui