# Specifying schema using from\_numpy()

**URL:** <https://discuss.ray.io/t/specifying-schema-using-from-numpy/9764>\
**Category:** Ray Data\
**Created:** [March 14, 2023, 11:09pm UTC](https://discuss.ray.io/t/specifying-schema-using-from-numpy/9764 "2023-03-14T23:09:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin-Tan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/justin-tan/32/4060_2.png) [@Justin-Tan](https://discuss.ray.io/u/Justin-Tan)\
**Post date:** [March 14, 2023, 11:09pm UTC](https://discuss.ray.io/t/specifying-schema-using-from-numpy/9764/1 "2023-03-14T23:09:00Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

When creating a dataset from a list of NumPy arrays, is it possible to specify the schema alongside? Each Numpy array (`[a,b,...]`) is a variable-sized array (`[N,size_1], [N, size_2]`,…), and I’d like to yield batches of each array as a dict `DIct[str, np.ndarray]` during training in the same way as the linked example in the 2.3.0. docs for consuming multi-column tensor data: [ML Tensor Support — Ray 2.3.0](https://docs.ray.io/en/latest/data/dataset-tensor-support.html#transforming-consuming-tensor-data)

---

<div class="post-metadata">

**Author:** ![bveeramani](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/bveeramani/32/2941_2.png) [@bveeramani](https://discuss.ray.io/u/bveeramani)\
**Post date:** [March 15, 2023, 7:29pm UTC](https://discuss.ray.io/t/specifying-schema-using-from-numpy/9764/2 "2023-03-15T19:29:51Z")

</div>

Hey @Justin-Tan,

Thanks for posting your question.

What would specifying the schema let you do? Is it so that you can yield batches of `dict[str, np.ndarray]` instead of `np.ndarray`?

Also, do you want to yield `dict`s with multiple key? If so, what would that look like?
