def load_search_freq ( fp = SEARCH_FREQ_JSON ) : try : with open ( fp ) as f : return Counter ( json . load ( f ) ) except FileNotFoundError : return Counter ( )
how to get the count in json file using python
Load the search_freq from JSON file
def load_search_freq(fp=SEARCH_FREQ_JSON):
    """
    Load the search_freq from JSON file
    """
    try:
        with open(fp) as f:
            return Counter(json.load(f))
    except FileNotFoundError:
        return Counter()