#!/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# File Name: analysis.py
# Author : Wenjing Fan
# Email: fwjfan@ucdavis.edu
# Created Time: Wed Mar  4 01:19:54 2020
# print the most five frequently appeared locations
#########################################################################
import json
from pandas import DataFrame
with open("list.txt",'r') as load_f:
    dicList = json.load(load_f)
frame=DataFrame(dicList)
#print(frame['Location'].value_counts()[:5])

#if not enough, fill with missing
locList=frame['Location'].fillna('Missing')
locList[locList =='']='Unknown'
print(locList.value_counts()[:5])


3e3bda8f0ca163c887ac9c2645d85e686eae3ea9
<mask token>

<mask token>
with open('list.txt', 'r') as load_f:
    dicList = json.load(load_f)
<mask token>
print(locList.value_counts()[:5])

<mask token>
with open('list.txt', 'r') as load_f:
    dicList = json.load(load_f)
frame = DataFrame(dicList)
locList = frame['Location'].fillna('Missing')
locList[locList == ''] = 'Unknown'
print(locList.value_counts()[:5])

import json
from pandas import DataFrame
with open('list.txt', 'r') as load_f:
    dicList = json.load(load_f)
frame = DataFrame(dicList)
locList = frame['Location'].fillna('Missing')
locList[locList == ''] = 'Unknown'
print(locList.value_counts()[:5])

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# File Name: analysis.py
# Author : Wenjing Fan
# Email: fwjfan@ucdavis.edu
# Created Time: Wed Mar  4 01:19:54 2020
# print the most five frequently appeared locations
#########################################################################
import json
from pandas import DataFrame
with open("list.txt",'r') as load_f:
    dicList = json.load(load_f)
frame=DataFrame(dicList)
#print(frame['Location'].value_counts()[:5])

#if not enough, fill with missing
locList=frame['Location'].fillna('Missing')
locList[locList =='']='Unknown'
print(locList.value_counts()[:5])

