blaze / datashape

Language defining a data description protocol
BSD 2-Clause "Simplified" License
183 stars 65 forks source link

Infer datashape of slice of dataset #55

Closed mrocklin closed 10 years ago

mrocklin commented 10 years ago

I want something like the following. Do we have this already somewhere?

>>> ds = dshape('var * {name: string, amount: int}')
>>> index = (slice(0, 5), 'amount')

>>> dshape_of_subset(index, ds)
'5 * int'

>>> dshape_of_subset(0, ds)
'{name: string, amount: int}'

CC @mwiebe