mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-08 06:45:54 +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:
|
with open(r"cancel_data.csv", "w") as f:
|
||||||
f.write(content)
|
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
|
# 1: pre-processing data
|
||||||
del data[data.columns.tolist()[0]]
|
del data[data.columns.tolist()[0]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user