def load_json(filename):
'''
Function:
- opens json file and store information in a pandas dataframe
- also prints out aggregated df with counts of picture by countrycode
Input:
1. filename/path ex: ./data/filename.json
Output:
1. new dataframe containing json info
'''
df = pd.read_json(filename, lines=True)
test = df.groupby(df['countrycode']).count()
print test.sort(columns='drawing',ascending=False).head(15)
return df
feature_engineering_func.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录