# Best data structure for a 2D array of generic cell content?

**URL:** <https://forum.modular.com/t/best-data-structure-for-a-2d-array-of-generic-cell-content/3642>\
**Category:** Mojo\
**Created:** [November 8, 2026, 3:18am UTC](https://forum.modular.com/t/best-data-structure-for-a-2d-array-of-generic-cell-content/3642 "2026-11-08T03:18:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stu002](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@stu002](https://forum.modular.com/u/stu002)\
**Post date:** [November 8, 2026, 3:18am UTC](https://forum.modular.com/t/best-data-structure-for-a-2d-array-of-generic-cell-content/3642/1 "2026-11-08T03:18:30Z")

</div>

I’d like to create a 2D array which is parameterized over the type of array elements. The most important operations are finding neighbouring cells for a cell and reading/writing cells. I’m not doing any matrix/vector style operations.

I can definitely do this by using a List[List[T]]. I also looked into the NumPy style packages for Mojo which I think assume the array content is some kind of scalar numeric type?

Is there anything between nested lists and numeric arrays that could do this?

---

<div class="post-metadata">

**Author:** ![CreativeNothing](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/creativenothing/32/607_2.png) [@CreativeNothing](https://forum.modular.com/u/CreativeNothing)\
**Post date:** [November 8, 2026, 10:09am UTC](https://forum.modular.com/t/best-data-structure-for-a-2d-array-of-generic-cell-content/3642/2 "2026-11-08T10:09:52Z")

</div>

TileTensor from the MAX side of things is probably what you want to investigate

---

<div class="post-metadata">

**Author:** ![stu002](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@stu002](https://forum.modular.com/u/stu002)\
**Post date:** [November 8, 2026, 9:21pm UTC](https://forum.modular.com/t/best-data-structure-for-a-2d-array-of-generic-cell-content/3642/3 "2026-11-08T21:21:05Z")

</div>

Thanks!
