Skip to content

Commit c405539

Browse files
committed
issue TheAlgorithms#11150 Ensure explicit column selection and data type setting in data reading process.
1 parent c6ca194 commit c405539

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: machine_learning/sequential_minimum_optimization.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,11 @@ def test_cancel_data():
463463
with open(r"cancel_data.csv", "w") as f:
464464
f.write(content)
465465

466-
data = pd.read_csv(r"cancel_data.csv", header=None)
466+
data = pd.read_csv(
467+
"cancel_data.csv",
468+
header=None,
469+
dtype={0: str} # Assuming the first column contains string data
470+
)
467471

468472
# 1: pre-processing data
469473
del data[data.columns.tolist()[0]]

0 commit comments

Comments
 (0)