Work in Progress
In [1]:
# read population in
import json
import requests
from pandas import DataFrame
# pop_json_url holds a
pop_json_url = "https://gist.github.com/rdhyee/8511607/raw/f16257434352916574473e63612fcea55a0c1b1c/population_of_countries.json"
pop_list= requests.get(pop_json_url).json()
df = DataFrame(pop_list)
df[:5]
Out[1]:
Q: What is the relationship between s and the population of China?
s = sum(df[df[1].str.startswith('C')][2])
s is greater than the population of Chinas is the same as the population of Chinas is less than the population of Chinas is not a number.
In [2]:
from pandas import DataFrame, Series, Index
import numpy as np
s1 = Series(np.arange(1,4))
s1
Out[2]:
Q: What is
s1.apply(lambda k: 2*k).sum()
Q: What is s1.cumsum()[1]?
In [2]: