from pandas import DataFrame import json import sys import util input = open(sys.argv[1],'r') divisions = json.loads(input.readline()) user_dataframe = DataFrame.from_csv("LocalData/user.csv") time_list = user_dataframe['created_at'] for i in range(len(divisions)-1): count = util.count_ele(time_list,divisions[i],divisions[i+1]) print count
from pandas import DataFrame import json import sys import util input = open(sys.argv[1],'r') gaps = json.loads(input.readline()) user_dataframe = DataFrame.from_csv("LocalData/repo.csv") star_list = user_dataframe['watchers'] start = 0 for i in range(len(gaps)): count = util.count_ele(star_list, start, start+gaps[i]) start += gaps[i] print count
from pandas import DataFrame import json import sys import util input = open(sys.argv[1], "r") gaps = json.loads(input.readline()) user_dataframe = DataFrame.from_csv("LocalData/repo.csv") fork_list = user_dataframe["forks"] start = 0 for i in range(len(gaps)): count = util.count_ele(fork_list, start, start + gaps[i]) start += gaps[i] print count
from pandas import DataFrame import json import sys import util # Param: # A list of integers(JSON) as gap for the ranges. # Result: # Lines of integers telling number of users in each range. input = open(sys.argv[1],'r') gaps = json.loads(input.readline()) user_dataframe = DataFrame.from_csv("LocalData/user.csv") follower_list = user_dataframe['followers'] start = 0 for i in range(len(gaps)): count = util.count_ele(follower_list,start,start+gaps[i]) start += gaps[i] print count