更新 function.py
Gitea Actions Test / Challenge-Actions (push) Successful in 21s

This commit is contained in:
2024-11-21 17:18:37 +08:00
parent 3a01cb9965
commit eedbad4e44
+2 -1
View File
@@ -89,7 +89,8 @@ def load_data(filepath):
- np.array: 特征数据。 - np.array: 特征数据。
- np.array: 标签数据。 - np.array: 标签数据。
""" """
data = np.loadtxt(filepath, delimiter=',', dtype=str, comments=None) # 使用空格作为分隔符加载数据
data = np.loadtxt(filepath, delimiter=' ', dtype=str, comments=None)
# 检查数据的维度 # 检查数据的维度
if data.ndim == 1: if data.ndim == 1: