Repository: modin-project/modin

Issue:
BUG: Indexing a 2D array gives wrong shape if we select a row
### Modin version checks

- [X] I have checked that this issue has not already been reported.

- [X] I have confirmed this bug exists on the latest released version of Modin.

- [X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow [this guide](https://modin.readthedocs.io/en/stable/getting_started/installation.html#installing-from-the-github-master-branch).)


### Reproducible Example

```python
In [1]: import modin.pandas as pd
In [2]: from modin.config import ExperimentalNumPyAPI

In [3]: df = pd.DataFrame([[1.2, 2.2],[3.2, 4.2],[5.2, 6.2]], columns = ["COL1", "COL2"])

In [4]: df.to_numpy()[0]
Out[4]: array([1.2, 2.2])

In [5]: df.to_numpy()[0].shape
Out[5]: (1,)
```


### Issue Description

Since we are selecting a single row, it stays as a row in the df, so we think we have a [1x2] object, because 1d objects are stored as columns. We need to transpose the qc so that it knows it is a 1d object.

### Expected Behavior

Shape should be 2

### Error Logs

<details>

```python-traceback

Replace this line with the error backtrace (if applicable).

```

</details>


### Installed Versions

<details>

Replace this line with the output of pd.show_versions()

</details>



Discussion:

Resolving patch:
diff --git a/modin/numpy/indexing.py b/modin/numpy/indexing.py
--- a/modin/numpy/indexing.py
+++ b/modin/numpy/indexing.py
@@ -318,6 +318,8 @@ def _get_numpy_object_from_qc_view(
                 _ndim = 2
             else:
                 _ndim = 1
+                if row_scalar:
+                    qc_view = qc_view.transpose()
 
         if _ndim == 0:
             return qc_view.to_numpy()[0, 0]


Test patch:
diff --git a/modin/numpy/test/test_array_indexing.py b/modin/numpy/test/test_array_indexing.py
new file mode 100644
--- /dev/null
+++ b/modin/numpy/test/test_array_indexing.py
@@ -0,0 +1,93 @@
+# Licensed to Modin Development Team under one or more contributor license agreements.
+# See the NOTICE file distributed with this work for additional information regarding
+# copyright ownership.  The Modin Development Team licenses this file to you under the
+# Apache License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under
+# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific language
+# governing permissions and limitations under the License.
+
+import numpy
+import pytest
+from pandas.core.dtypes.common import is_list_like
+
+import modin.numpy as np
+
+
+@pytest.mark.parametrize(
+    "index",
+    (
+        0,
+        1,
+        -1,  # Scalar indices
+        slice(0, 1, 1),
+        slice(1, -1, 1),  # Slices
+        [0, 2],
+        [1, -1],  # Lists
+    ),
+    ids=lambda i: f"index={i}",
+)
+def test_getitem_1d(index):
+    data = [1, 2, 3, 4, 5]
+    numpy_result = numpy.array(data)[index]
+    modin_result = np.array(data)[index]
+    if is_list_like(numpy_result):
+        numpy.testing.assert_array_equal(modin_result._to_numpy(), numpy_result)
+        assert modin_result.shape == numpy_result.shape
+    else:
+        assert modin_result == numpy_result
+
+
+@pytest.mark.parametrize(
+    "index",
+    (
+        0,
+        1,
+        -1,  # Scalar indices
+        slice(0, 1, 1),
+        slice(1, -1, 1),  # Slices
+        slice(None, None, None),
+        slice(None, 1, None),
+        slice(0, 1, None),
+        slice(0, None, None),
+        [0, 2],
+        [2, 0],
+        [1, -1],  # Lists
+    ),
+    ids=lambda i: f"index={i}",
+)
+def test_getitem_2d(index):
+    data = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
+    numpy_result = numpy.array(data)[index]
+    modin_result = np.array(data)[index]
+    if is_list_like(numpy_result):
+        numpy.testing.assert_array_equal(modin_result._to_numpy(), numpy_result)
+        assert modin_result.shape == numpy_result.shape
+    else:
+        assert modin_result == numpy_result
+
+
+def test_getitem_nested():
+    # Index into the result of slicing a 1D array
+    data = [1, 2, 3, 4, 5]
+    numpy_result = numpy.array(data)[1:3][1]
+    modin_result = np.array(data)[1:3][1]
+    if is_list_like(numpy_result):
+        numpy.testing.assert_array_equal(modin_result._to_numpy(), numpy_result)
+        assert modin_result.shape == numpy_result.shape
+    else:
+        assert (
+            modin_result == numpy_result
+        )  # Index into the result of indexing a 2D array
+    data = [[1, 2, 3], [4, 5, 6]]
+    numpy_result = numpy.array(data)[1][1]
+    modin_result = np.array(data)[1][1]
+    if is_list_like(numpy_result):
+        numpy.testing.assert_array_equal(modin_result._to_numpy(), numpy_result)
+        assert modin_result.shape == numpy_result.shape
+    else:
+        assert modin_result == numpy_result