Exemplo n.º 1
0
""" Download and use locations
"""
import os
import pandas as pd
import WebSearcher as ws

# Retrieve and save latest location data
data_dir = './location_data'
ws.download_locations(data_dir)

# Read it back in
f = os.listdir(data_dir)[-1]  # Last file
fp = os.path.join(data_dir, f)  # File path
locs = pd.read_csv(fp)  # Read

# locs.info()
#
# <class 'pandas.core.frame.DataFrame'>
# RangeIndex: 102029 entries, 0 to 102028
# Data columns (total 7 columns):
# Criteria ID       102029 non-null int64
# Name              102029 non-null object
# Canonical Name    102029 non-null object
# Parent ID         101788 non-null float64
# Country Code      102013 non-null object
# Target Type       102029 non-null object
# Status            102029 non-null object
# dtypes: float64(1), int64(1), object(5)
# memory usage: 5.4+ MB

# locs.iloc[0]