Skip to content

Commit 5ba433e

Browse files
MannCodepre-commit-ci[bot]
authored andcommitted
issue TheAlgorithms#11150 Ensure explicit column selection and data type setting in data reading process. (TheAlgorithms#11302)
* issue TheAlgorithms#11150 Ensure explicit column selection and data type setting in data reading process. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3d70575 commit 5ba433e

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)