import pandas as pd
print(pd.__version__)
city_names = pd.Series(['San Francisco', 'San Jose', 'Sacramento'])
population = pd.Series([852469, 1015785, 485199])
#city_population_table = pd.DataFrame(({'City name': city_names, 'Population': population}))
california_houseing_dataframe = pd.read_csv("https://storage.googleapis.com/mledu-datasets/california_housing_train.csv", sep=",")
california_houseing_dataframe.describe()
california_houseing_dataframe.head()
#some error
#california_houseing_dataframe.hist('housing_median_age')
cities = pd.DataFrame({'City name': city_names, 'Population': population})
#print(type(cities['City name']))
#print(cities['City name'])
#print(type(cities['City name'][1]))
#print(cities['City name'][1])
#print(type(cities[0:2]))
#print(cities[0:2])
#print(population / 1000)
import numpy as np
np.log(population)
#print(population.apply(lambda val: val > 10000))
cities['Area square miles'] = pd.Series([46.87, 176.53, 97.92])
#print(cities)
cities['Population density'] = cities['Population'] / cities['Area square miles']
#print(cities)
print(city_names.index)
print(cities.reindex([2, 0, 1]))
print(cities)
[(3, 'pandas.Series', 'pd.Series', True, 'import pandas as pd\n'), (4, 'pandas.Series', 'pd.Series', True, 'import pandas as pd\n'), (6, 'pandas.read_csv', 'pd.read_csv', True, 'import pandas as pd\n'), (11, 'pandas.DataFrame', 'pd.DataFrame', True, 'import pandas as pd\n'), (20, 'numpy.log', 'np.log', True, 'import numpy as np\n'), (22, 'pandas.Series', 'pd.Series', True, 'import pandas as pd\n')]