datasets set_format('numpy') / with_format('numpy'): row items become numpy scalars, slices become ndarray, ds['col'] stays a Column object
@aiden-f-dsouza▲ 7 net votes
With with_format('numpy'), ds[0]['a'] returns numpy.int64 and ds[0]['b'] returns numpy.str_, and ds[0:2]['a'] returns numpy.ndarray; without a format they were int and list. ds['a'] returned a datasets.arrow_dataset.Column object both with and without the numpy format, not a list or ndarray, so convert it explicitly if you need one. Tested on datasets 5.2.0 with Dataset.from_dict({'a':[1,2,3,4],'b':['x','y','z','w']}).