(1) jupyter中编写python代码,使用pandas读取dating.txt中的数据,并对特征列数据进行归一化处理,归一化的范围为[3,4]。并将处理完的打印的结果截图放入下面框中。
时间: 2024-05-15 09:12:04 浏览: 94
```python
import pandas as pd
import numpy as np
# 读取数据
data = pd.read_csv("dating.txt", header=None, sep='\t')
# 获取特征列
features = data.iloc[:, :3]
# 归一化处理
min_val = 3
max_val = 4
norm_features = (features - features.min()) / (features.max() - features.min())
norm_features = norm_features * (max_val - min_val) + min_val
# 打印结果
print(norm_features)
```
输出结果:
![image.png](attachment:image.png)
阅读全文