code: def make_geohash_tables(table,listofprecisions,**kwargs):
  	'''
  	sort_by - field to sort by for each group
  	return_squares - boolean arg if true returns a list of squares instead of writing out to table
  	'''
  	return_squares = False
  	sort_by = 'COUNT'
  	for key,value in kwargs.iteritems():
  		if key == 'sort_by':
  			sort_by = value
  		if key == 'return_squares':
  			return_squares = value
  	header = df2list(table)[0]
  	columns = header[10:]
  	originaltable = table
  	if not sort_by == 'COUNT':
  		originaltable = originaltable.sort([sort_by],ascending=[0])
  	listofprecisions = sorted(listofprecisions,reverse=True)
  	if return_squares == True and listofprecisions[-1] == 8:
  		total_list = [table]
  	elif return_squares == True:
  		total_list = []
  	for row in listofprecisions:
  		precision = int(row)
  		table = originaltable
  		table['GEOHASH'] = table.GEOHASH.str[:precision]
  		table = table[['GEOHASH','COUNT']+columns].groupby(['GEOHASH'],sort=True).sum()
  		table = table.sort([sort_by],ascending=[0])
  		table = table.reset_index()
  		newsquares = [header]
  		for row in df2list(table)[1:]:
  			points = get_points_geohash(row[0])
  			newrow = [row[0]] + points + row[1:]
  			newsquares.append(newrow)
  		table = list2df(newsquares)
  		if return_squares == True:
  			total_list.append(table)
  		else:
  			table.to_csv('squares' + str(precision) + '.csv',index=False)
  	if return_squares == True:
  		return total_list
  	else:
  		print 'Wrote output squares tables to csv files.'