def test_isna(self):
        expected = np.array([False, True, False, False])

        # Test numeric
        x = np.array([[1, 2], [np.nan, np.nan], [3, np.nan], [5, 6]])
        s = TensorArray(x)
        result = s.isna()
        npt.assert_equal(result, expected)

        # Test object
        d = {"a": 1}
        x = np.array([[d, d], None, [d, None], [d, d]], dtype=object)
        s = TensorArray(x)
        result = s.isna()
        npt.assert_equal(result, expected)

        # Test str
        x = np.array([["foo", "foo"], ["", ""], ["bar", ""], ["baz", "baz"]])
        s = TensorArray(x)
        result = s.isna()
        npt.assert_equal(result, expected)
    def test_create_from_scalar_list(self):
        x = [1, 2, 3, 4, 5]
        s = TensorArray(x)
        self.assertTupleEqual(s.numpy_shape, (len(x),))
        expected = np.array(x)
        npt.assert_array_equal(s.to_numpy(), expected)

        # Now with TensorElement values
        e = [TensorElement(np.array(i)) for i in x]
        s = pd.array(e, dtype=TensorDtype())
        npt.assert_array_equal(s.to_numpy(), expected)

        # Now with list of 1d tensors
        x = [np.array([i]) for i in x]
        s = pd.array(x, dtype=TensorDtype())
        self.assertTupleEqual(s.to_numpy().shape, (len(x), 1))
        npt.assert_array_equal(s.to_numpy(), np.array([[e] for e in expected]))

        # Pandas will create list of copies of the tensor element for the given indices
        s = pd.Series(np.nan, index=[0, 1, 2], dtype=TensorDtype())
        self.assertEqual(len(s), 3)
        self.assertTupleEqual(s.to_numpy().shape, (3,))
        result = s.isna()
        self.assertTrue(np.all(result.to_numpy()))