李宏毅2020深度学习课程作业-Homework 1: Linear Regression

作业链接:https://blog.csdn.net/iteapoy/article/details/105431738

笔记链接:https://github.com/Sakura-gh/ML-notes(包含作业和笔记)

作业目标:由前9小时的18个feature(包含PM2.5)预测第10个小时的PM2.5

数据:  链接:https://pan.baidu.com/s/1vpeNkg13rHtWeg_Mt6v-1w   提取码:opor

错误汇集

1、AttributeError: 'data' object has no attribute 'to_numpy'

2、SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

我是将testdata换成test_data

test_data = pd.read_csv('./test.csv', header = None, encoding = 'big5')
test_data = test_data.iloc[:, 2:]
test_data[test_data == 'NR'] = 0
test_data = test_data.to_numpy()

 

Guess you like

Origin blog.csdn.net/Vpn_zc/article/details/106994330