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:
Mandeep Singh 2024-06-02 18:27:35 -07:00 committed by GitHub
parent edee8e644b
commit 2f1704dae5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]]