Skip to content

DynamicItemDataset changes fields to string #3027

Closed

Description

@minniekabra

Describe the bug

Below, the column types are being changed to string, by DynamicItemDataset:

import speechbrain as sb
import pandas as pd
df=pd.DataFrame(columns=['ID', 'duration', 'rand'])
df.loc[0]=[1,1.3, 1.3]
df.loc[1]=[2, 2.1, 3.2]
df.to_csv('test_file.csv', index=False)
train_data = sb.dataio.dataset.DynamicItemDataset.from_csv(
        csv_path="test_file.csv",
        replacements={"data_root": "./"},
    )

train_data - Output ->

The column 'rand' has been changed to type 'string'. The data type of column 'duration' has been preserved.

train_data.data
{'1.0': {'duration': 1.3, 'rand': '1.3'},
 '2.0': {'duration': 2.1, 'rand': '3.2'}}

Expected behaviour

train_data.data
{'1.0': {'duration': 1.3, 'rand': 1.3},
 '2.0': {'duration': 2.1, 'rand': 3.2}}

To Reproduce

No response

Environment Details

No response

Relevant Log Output

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions