Skip to content
Advertisement

Tag: json

ValueError: All arrays must be of the same length

can someone help with the error with converting a json file to a data frame pls I’m trying to convert the JSON text file to a data frame but get the array same length error. I have tried double [[]] around the ‘data’ but still doesn’t work. The text file is at https://stackoverflowtez.filecloudonline.com/ui/core/index.html?mode=single&path=/SHARED/%212CkRNC5x55IO6kGJjEwTViZ4mGmwG/9aINFGD2QxaELHFL&shareto=#expl-tabl. A portion of JSON pasted below, the

How to group a json by a nested key using Python?

Lets say we have a json object in Python: What is the most efficient way to group this data by city, so that we end up with a json in which we group the data by city such that we end up with a json as: … in which the content of the people are included in “people” key. Thanks!

Transform list to dictionary with ID’s and content [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 months ago. Improve this question Given list is llist = [‘4|right’, ‘ 2|left’, ‘ 2|down’, ‘ 2|right’] And the output must be like this: Answer The provided output is invalid

Seach in JSON with variable depth and structure

I have some highly nested JSON files I need to work with. A short example: I would now like to read all names from the JSON file and write them into a list. This is not particularly difficult if the JSON file has a fixed structure. However, my JSON files have a variable structure and variable depth. Sometimes everything happens

How do i delete an element of a json object with python?

I’m trying to delete elements from _notes that have _type as 1, but i keep getting an error and I’m not sure what it means, nor do I know how to fix it.. can anyone help me? My trimmed JSON: My python script: Error: Traceback (most recent call last): File “C:programmingpythontrain_one_handrun.py”, line 9, in <module> obj.pop(obj[“_notes”][i]) TypeError: unhashable type: ‘dict’

Advertisement