mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
issue #11150 Ensure explicit column selection and data type setting in 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>
This commit is contained in:
parent
edee8e644b
commit
2f1704dae5
|
@ -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]]
|
||||
|
|
Loading…
Reference in New Issue
Block a user