Get to know ben_p with this User Highlight Learn More

dtype in dataiku.Dataset().get_dataframe()

Dataiker
Dataiker
dtype in dataiku.Dataset().get_dataframe()

Is there a way to use an equivalent of dtype (from pd.read_table()) inside dataiku.Dataset() or dataiku.Dataset.get_dataframe() ?




my_file = pd.read_table("input_file"
, dtype={
'field1':str,
,'field2':str})


I'm trying, but both of these output an unexpected keyword argument error : 




mydataset = dataiku.Dataset("input_file"
, dtype={
'field1':str,
,'field2':str})
my_file = mydataset.get_dataframe()


mydataset = dataiku.Dataset("input_file")
my_file = mydataset.get_dataframe(dtype={
'field1':str,
,'field2':str})



 



Thanks

0 Kudos
1 Reply
Dataiker
Dataiker
At the moment (DSS 4.0), it's not possible to force dtypes. This is something we're considering adding.

You can however use "infer_with_pandas=False", which will force the dtypes as specified by the dataset schema.
Labels (2)