Skip to content

Instantly share code, notes, and snippets.

@gdoteof
Created October 21, 2018 20:52
Show Gist options
  • Save gdoteof/7fb2b268c65031d123a200be1fe5ffbc to your computer and use it in GitHub Desktop.
Save gdoteof/7fb2b268c65031d123a200be1fe5ffbc to your computer and use it in GitHub Desktop.
def expandJson(df, colName):
jsonString = df.iloc[0][colName]
decoded = json.loads(jsonString)
attrs = decoded.keys()
print(attrs)
fld = df[colName]
for attr in attrs: df[colName+attr] = [loadjson(x,attr) for x in fld]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment