[SOLVED] Is there a way to convert a dataset column type?

Is there a way to convert a dataset column type?

csv_data


script

I am trying to import a CSV file into a dataset tag but the numbers come in as strings. What would be the easiest way to accomplish this? Thanks for any guidance.

Used DataSetBuilder to create a dataset with the right column types.

Then copy the rows from your dataset with the wrong types into the dataset with the correct column types.

Or it might be as easy to manipulate the CSV to specify the correct types before turning it into a dataset:

2 Likes

@pturmel @witman

The man, the myth, the legend strikes again! Thanks Phil and witman.

image

Updated code attached.

1 Like

Updated the function to take a dictionary of integer keys and datatype values in other words

ds_dict = {0: Integer, 2: Integer}
2 Likes