You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior print(len(ds)) should return 10.
It returns 3 because it looks up indices slice(10), which match indices 0, 5 and 10 from the subset.
Describe the bug
CSVDataset accepts pandas DataFrames as input for src. But it makes assumptions about the index.
This is because
convert_tables_to_dicts
uses.loc
instead of.iloc
. It generates ordinal indexes to subset on but treats them as names indices.MONAI/monai/data/utils.py
Line 1494 in 0bb20a8
To Reproduce
Expected behavior
print(len(ds))
should return 10.It returns 3 because it looks up indices slice(10), which match indices 0, 5 and 10 from the subset.
Environment
Shouldn't be relevant?
Additional context
Simple fix:
MONAI/monai/data/utils.py
Line 1494 in 0bb20a8
The first .loc should be .iloc, and the second should be .iloc[rows][col_names]
The text was updated successfully, but these errors were encountered: