diff --git a/src/hdmf/container.py b/src/hdmf/container.py
index 2831aa8..2932f1e 100644
--- a/src/hdmf/container.py
+++ b/src/hdmf/container.py
@@ -3,7 +3,7 @@ from abc import abstractmethod
 from uuid import uuid4
 from six import with_metaclass
 from .utils import docval, get_docval, call_docval_func, getargs, ExtenderMeta
-from .data_utils import DataIO
+from .data_utils import DataIO, get_shape
 from warnings import warn
 import h5py
 
@@ -390,6 +390,15 @@ class Data(AbstractContainer):
     def data(self):
         return self.__data
 
+    @property
+    def shape(self):
+        """
+        Get the shape of the data represented by this container
+        :return: Shape tuple
+        :rtype: tuple of ints
+        """
+        return get_shape(self.__data)
+
     @docval({'name': 'dataio', 'type': DataIO, 'doc': 'the DataIO to apply to the data held by this Data'})
     def set_dataio(self, **kwargs):
         """

Add shape attribute on base classes of DynamicTableRegion
In https://github.com/hdmf-dev/hdmf/pull/191 we added the ``shape`` property to ``DynamicTableRegion`` For consistency we should add the ``shape`` property to the parent classes as well. This should require only adding  ``shape`` to ``container.Data``.  This should also make shape validation on these objects more efficient. 

## Checklist

- [X] Have you ensured the feature or change was not already [reported](https://github.com/hdmf-dev/hdmf/issues) ?
- [X] Have you included a brief and descriptive title?
- [X] Have you included a clear description of the problem you are trying to solve?
- [X] Have you included a minimal code snippet that reproduces the issue you are encountering?
- [X] Have you checked our [Contributing](https://github.com/hdmf-dev/hdmf/blob/dev/docs/CONTRIBUTING.rst) document?

diff --git a/tests/unit/test_container.py b/tests/unit/test_container.py
index 2d16dea..842517e 100644
--- a/tests/unit/test_container.py
+++ b/tests/unit/test_container.py
@@ -1,6 +1,7 @@
 import unittest
 
 from hdmf.container import AbstractContainer, Container, Data
+import numpy as np
 
 
 class Subcontainer(Container):
@@ -133,6 +134,20 @@ class TestData(unittest.TestCase):
         data_obj = Data('my_data', [])
         self.assertFalse(data_obj)
 
+    def test_shape_nparray(self):
+        """
+        Test that shape works for np.array
+        """
+        data_obj = Data('my_data', np.arange(10).reshape(2, 5))
+        self.assertTupleEqual(data_obj.shape, (2, 5))
+
+    def test_shape_list(self):
+        """
+        Test that shape works for np.array
+        """
+        data_obj = Data('my_data', [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]])
+        self.assertTupleEqual(data_obj.shape, (2, 5))
+
 
 if __name__ == '__main__':
     unittest.main()

pip install -e .
parse_log_pytest
requirements.txt
pytest coverage
apt-get update apt-get install -y gcc
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==3.0.4
coverage==7.2.7
exceptiongroup==1.2.2
h5py==2.10.0
-e git+https://github.com/hdmf-dev/hdmf.git@8ea04165c21e9020646203532a487b5db11529fb#egg=hdmf
importlib-metadata==6.7.0
iniconfig==2.0.0
numpy==1.17.2
packaging==24.0
pandas==0.25.1
pluggy==1.2.0
pytest==7.4.4
python-dateutil==2.9.0.post0
pytz==2025.2
ruamel.yaml==0.16.5
ruamel.yaml.clib==0.2.8
scipy==1.3.1
six==1.12.0
tomli==2.0.1
typing_extensions==4.7.1
zipp==3.15.0

name: hdmf
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - chardet==3.0.4
      - coverage==7.2.7
      - exceptiongroup==1.2.2
      - h5py==2.10.0
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - numpy==1.17.2
      - packaging==24.0
      - pandas==0.25.1
      - pluggy==1.2.0
      - pytest==7.4.4
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - ruamel-yaml==0.16.5
      - ruamel-yaml-clib==0.2.8
      - scipy==1.3.1
      - six==1.12.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/hdmf

tests/unit/test_container.py::TestData::test_shape_list tests/unit/test_container.py::TestData::test_shape_nparray
tests/unit/test_container.py::TestContainer::test_add_child tests/unit/test_container.py::TestContainer::test_constructor tests/unit/test_container.py::TestContainer::test_constructor_object_id_none tests/unit/test_container.py::TestContainer::test_reassign_container_source tests/unit/test_container.py::TestContainer::test_repr tests/unit/test_container.py::TestContainer::test_set_modified_parent tests/unit/test_container.py::TestContainer::test_set_parent tests/unit/test_container.py::TestContainer::test_set_parent_exists tests/unit/test_container.py::TestContainer::test_set_parent_overwrite tests/unit/test_container.py::TestContainer::test_set_parent_overwrite_proxy tests/unit/test_container.py::TestContainer::test_slash_restriction tests/unit/test_container.py::TestContainer::test_type_hierarchy tests/unit/test_container.py::TestData::test_bool_false tests/unit/test_container.py::TestData::test_bool_true
src/hdmf/container.py
src/hdmf/container.py