Skip to content

Commit

Permalink
issue TheAlgorithms#11150 Ensure explicit column selection and data t…
Browse files Browse the repository at this point in the history
…ype setting in data reading process.
  • Loading branch information
MannCode committed Feb 25, 2024
1 parent c6ca194 commit c405539
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 c405539

Please sign in to comment.