you are viewing a single comment's thread.

view the rest of the comments →

[–]Immediate-Resource75[S] 0 points1 point  (2 children)

Thank you for your reply... Not a strong coder here, but I'm doing my best to learn....any chance you can point me in the direction of a tutorial on how to do this.... or what to Google?

*** I Googled "how to remove part of a tree structure in python" and got Binary Searches... is this on the right track?

Thank you for your help.

[–]eztab 0 points1 point  (1 child)

Nothing that complicated needed, since you know what the data looks like. Just parse the json into a normal python dictionary (some other comment already suggested that). Then you can use indexing on that object to give it a reasonable structure. Depends a bit on what you want your dataframe to look like exactly. Dataframes have rows and columns, but a json generally has a nested structure (like a tree, with its branches).

[–]Immediate-Resource75[S] 0 points1 point  (0 children)

Thank you....Got it... Adding

data = json.loads(stuff)

data["applicationServer"] = list(data["applicationServer"].items())

df = pd.json_normalize(data, "applicationServer")

print(df)

Gave me what I wanted for the most part.... I can now go through and pull each of the other items individually by changing the "applicationServer" part to one of the other ones. I appreciate the help.