【House Prices】环境搭建

环境搭建

1.打开Kaggle相关比赛的地址,找到Data一栏,下载数据,需要train.csv和test.csv

2.用cmd在创建的目录下打开notebook,指令:jupyter notebook

3.测试读取数据

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# 忽略警告提示
import warnings
warnings.filterwarnings('ignore')
# 导入数据
# 训练数据集
trainf = open('E:/AI/Kaggle/HousePrice/train.csv')
train_df =pd.read_csv(trainf)
# 测试数据集
testf = open('E:/AI/Kaggle/HousePrice/test.csv')
test_df = pd.read_csv(testf)
print('训练数据集:',train_df.shape,"测试数据集:",test_df.shape)
train_df.head()

 

 

posted @ 2023-10-09 08:41  byxiaobai  阅读(16)  评论(0编辑  收藏  举报