Skip to content

Commit

Permalink
issue #11150 Ensure explicit column selection and data type setting i…
Browse files Browse the repository at this point in the history
…n data reading process. (#11302)

* issue #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>
  • Loading branch information
MannCode and pre-commit-ci[bot] authored Jun 3, 2024
1 parent edee8e6 commit 2f1704d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion machine_learning/sequential_minimum_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ def test_cancel_data():
with open(r"cancel_data.csv", "w") as f:
f.write(content)

data = pd.read_csv(r"cancel_data.csv", header=None)
data = pd.read_csv(
"cancel_data.csv",
header=None,
dtype={0: str}, # Assuming the first column contains string data
)

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

0 comments on commit 2f1704d

Please sign in to comment.