1 导入文件
(1)导入csv文件
import pandas as pd
import numpy as np
dataset = pd.read_csv(‘us_cities.csv’)
col = dataset.columns.values.tolist() # 获得列的名称
data = np.array(dataset[col[2:-1]]) # 取出某一列
(2)导入json文件
import json
with open("./train.json", 'r') as load_f:
load_dict = json.load(load_f) # reading in
print(load_dict.keys())
print(load_dict['bathrooms'])
print(load_dict['street_address'])