Skip to content

Commit edc5b8b

Browse files
authored
Update 3.16_kaggle-house-price.ipynb
np.float 在 numpy 1.20 中被抛弃,这里应使用 float 或 np.float64 执行代码时的报错如下: AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
1 parent 92a492c commit edc5b8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

code/chapter03_DL-basics/3.16_kaggle-house-price.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@
292292
"outputs": [],
293293
"source": [
294294
"n_train = train_data.shape[0]\n",
295-
"train_features = np.array(all_features[:n_train].values,dtype=np.float)\n",
296-
"test_features = np.array(all_features[n_train:].values,dtype=np.float)\n",
297-
"train_labels = np.array(train_data.SalePrice.values.reshape(-1, 1),dtype=np.float)"
295+
"train_features = np.array(all_features[:n_train].values,dtype=float)\n",
296+
"test_features = np.array(all_features[n_train:].values,dtype=float)\n",
297+
"train_labels = np.array(train_data.SalePrice.values.reshape(-1, 1),dtype=float)"
298298
]
299299
},
300300
{

0 commit comments

Comments
 (0)