Created
October 21, 2018 20:52
-
-
Save gdoteof/7fb2b268c65031d123a200be1fe5ffbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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