Category : key

Currently, I’m creating to JSON with this code: import pandas as pd import csv data = pd.read_csv(r’C:UsersuserDownloadsconfig_all_env.csv’) # print(data.to_string()) df = pd.DataFrame(data) # print(df) json_file = df.to_json(orient=’index’,indent=4) print(json_file) my ‘config_all_env.csv’ looks like this _key,index,source 123456789100:LogGroup1,index1,Account1-123456789100:LogGroup1 123456789100:LogGroup2,index1,Account1-123456789100:LogGroup2 678901234200:LogGroup3,index2,Account2-678901234200:LogGroup3 678901234200:LogGroup4,index2,Account2-678901234200:LogGroup4 And the Output is like this: { "0":{ "_key":"123456789100:LogGroup1", "index":"index1", "source":"Account1-123456789100:LogGroup1" }, "1":{ "_key":"123456789100:LogGroup2", "index":"index1", "source":"Account1-123456789100:LogGroup2" }, ..

Read more

I install the occamypy package, but I can not use it. As I import the package in python, it gives this error: Can anyone help me to resolve this issue? File "C:UsersArashanaconda3libsite-packagesoccamypyutilssep.py", line 8, in <module> HOME = os.environ["HOME"] File "C:UsersArashanaconda3libos.py", line 675, in __getitem__ raise KeyError(key) from None KeyError: ‘HOME’ Source: Python..

Read more