Harika22 commited on
Commit
ef5cd02
·
verified ·
1 Parent(s): 750e1d6

Update pages/6_Semi_structured_data.py

Browse files
Files changed (1) hide show
  1. pages/6_Semi_structured_data.py +9 -1
pages/6_Semi_structured_data.py CHANGED
@@ -394,7 +394,15 @@ elif file_type == "JSON":
394
  pd.json_normalize(b)
395
  ''')
396
 
397
-
 
 
 
 
 
 
 
 
398
 
399
 
400
 
 
394
  pd.json_normalize(b)
395
  ''')
396
 
397
+ st.header("Converting DataFrame into JSON...")
398
+ st.code('''import pandas as pd
399
+ a = {"name":"harii","age":23,"marks":{"sem1":{"hindi":10,"science":39},"sem2":{"hindi":12,"science":32}}}
400
+ pd.json_normalize(a)
401
+ pd.json_normalize(a,max_level=1)
402
+ ''')
403
+ st.markdown('''
404
+ - **max_level** gives how much deeper it takes to take the values of column
405
+ ''')
406
 
407
 
408