<s> import berrl as bl <EOL> import pandas as pd <EOL> import numpy as np <EOL> import itertools <EOL> apikey = '<STR_LIT>' <EOL> colors = [ '<STR_LIT:default>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> data = pd . read_csv ( '<STR_LIT>' ) <EOL> data = bl . map_table ( data , <NUM_LIT:3> , list = True ) <EOL> squares = pd . read_csv ( '<STR_LIT>' ) <EOL> squares = squares [ : <NUM_LIT:10> ] <EOL> geohashs = np . unique ( squares [ '<STR_LIT>' ] ) . tolist ( ) <EOL> total = [ data . columns . values . tolist ( ) ] <EOL> for row in geohashs : <EOL> temp = data [ data . GEOHASH == str ( row ) ] <EOL> temp = bl . df2list ( temp ) <EOL> total += temp [ <NUM_LIT:1> : ] <EOL> total = bl . list2df ( total ) <EOL> uniques = np . unique ( total [ '<STR_LIT>' ] ) . tolist ( ) <EOL> count = <NUM_LIT:0> <EOL> filenames = [ ] <EOL> for unique , color in itertools . izip ( uniques , colors ) : <EOL> count += <NUM_LIT:1> <EOL> filename = str ( count ) + '<STR_LIT>' <EOL> temp = total [ total . Activity == unique ] <EOL> if not len ( temp ) == <NUM_LIT:0> : <EOL> temp [ '<STR_LIT>' ] = str ( color ) <EOL> a = bl . make_points ( temp , list = True ) <EOL> bl . parselist ( a , filename ) <EOL> filenames . append ( filename ) <EOL> squares [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> a = bl . make_blocks ( squares , list = True ) <EOL> bl . parselist ( a , '<STR_LIT>' ) <EOL> filenames . append ( '<STR_LIT>' ) <EOL> bl . loadparsehtml ( filenames , apikey , colorkey = '<STR_LIT>' ) </s>
