skip to Main Content

flatten json object using jq

I have the following json object: { "id":1, "activities":[ {"time":1659800397,"cities":["london","paris"],"type":1}, {"time":1659800411,"cities":["rome"], "type":2} ] } I would like to flatten it to the following tab separated structure, perhaps using jq id time cities type 1 1659800397 london 1 1 1659800397 paris…

VIEW QUESTION

How do I make my JSON file readable in my pandas dataframe?

Here is my code: with open(r'unique_columns.json', 'r') as f: config = json.load(f) unique_col_comb = config['Unique_Column_Combination']['TABLE_NAME'] df = pd.read_csv(f's3://path/to/file.csv', sep='|') df_unique = df.set_index([unique_col_comb]).index.is_unique print(df_unique) My JSON looks like this: { "Unique_Column_Combination": { "TABLE_NAME": "COL1, COL2, COL3" } } I get the…

VIEW QUESTION
Back To Top
Search