Skip to content

Commit 5374ef3

Browse files
authored
Merge pull request #52 from aesuli/read_csv
Fix regex for whitespace delimiter in CSV reads
2 parents f4ac6da + c1ae859 commit 5374ef3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

quapy/data/datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def download(id: int | None, group: str) -> dict:
486486
# fall back to direct download when needed
487487
if group == "german":
488488
with download_tmp_file("statlog/german", "german.data-numeric") as tmp:
489-
df = pd.read_csv(tmp, header=None, delim_whitespace=True)
489+
df = pd.read_csv(tmp, header=None, sep="\\s+")
490490
X, y = df.iloc[:, 0:24].astype(float).values, df[24].astype(int).values
491491
elif group == "ctg":
492492
with download_tmp_file("00193", "CTG.xls") as tmp:
@@ -500,7 +500,7 @@ def download(id: int | None, group: str) -> dict:
500500
y = df["NSP"].astype(int).values
501501
elif group == "semeion":
502502
with download_tmp_file("semeion", "semeion.data") as tmp:
503-
df = pd.read_csv(tmp, header=None, sep='\s+')
503+
df = pd.read_csv(tmp, header=None, sep="\\s+")
504504
X = df.iloc[:, 0:256].astype(float).values
505505
y = df[263].values # 263 stands for digit 8 (labels are one-hot vectors from col 256-266)
506506
else:

0 commit comments

Comments
 (0)