Pandas相关

2018/05/30 posted in  Tensorflow
  1. Pandas 读取列数据

    city_names = pd.Series(['San Francisco', 'San Jose', 'Sacramento'])
    population = pd.Series([852469, 1015785, 485199])
    data = pd.DataFrame({ 'City name': city_names, 'Population': population })
    data['City_Name'] #获取'City_Name'这个列对象,返回值类型为Series
    data[['City_Name']] #获取'City_Name'列包含的数据,返回值类型为DateFrame