`check_array` error on Pandas series is confusing

### Describe the bug

I don't know if this is a bug or a feature request.

When inputing a Pandas or Polars series for estimators or transformers accepting only 2D arrays, `check_array()` raises the following error:
```
ValueError: Expected 2D array, got 1D array instead:
array=[1. 2. 3.].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
```
This is fine for arrays but for Pandas or Polars series this is confusing since using `reshape` will raise an error.

### Steps/Code to Reproduce

```python
import pandas as pd
from sklearn.preprocessing import StandardScaler

df = pd.DataFrame(dict(a=[1, 2, 3], b=["a", "b", "c"]))
StandardScaler().fit_transform(df["a"])
```

### Expected Results

An adapted error message to inform on what to do with a series and not an array.

```
ValueError: Expected a dataframe, got series instead:
0    1
1    2
2    3
Name: a, dtype: int64.
Pass a dataframe instead of a series with df[[column_name]] instead of df[column_name].
```

### Actual Results

```
ValueError: Expected 2D array, got 1D array instead:
array=[1. 2. 3.].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
```

### Versions

```shell
System:
    python: 3.10.11 | packaged by conda-forge | (main, May 10 2023, 19:07:22) [Clang 14.0.6 ]
executable: /Users/vincentmaladiere/mambaforge/envs/skrub/bin/python3.10
   machine: macOS-11.7.9-x86_64-i386-64bit

Python dependencies:
      sklearn: 1.3.0
          pip: 23.1.2
   setuptools: 67.7.2
        numpy: 1.25.2
        scipy: 1.10.1
       Cython: None
       pandas: 2.1.0rc0
   matplotlib: 3.7.1
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/vincentmaladiere/mambaforge/envs/skrub/lib/python3.10/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
        version: 0.3.23.dev
threading_layer: pthreads
   architecture: Haswell
    num_threads: 4

       user_api: openmp
   internal_api: openmp
         prefix: libomp
       filepath: /Users/vincentmaladiere/mambaforge/envs/skrub/lib/python3.10/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
    num_threads: 8

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/vincentmaladiere/mambaforge/envs/skrub/lib/python3.10/site-packages/scipy/.dylibs/libopenblas.0.dylib
        version: 0.3.18
threading_layer: pthreads
   architecture: SkylakeX
    num_threads: 4
```

COMMENT:
Hey, @lorentzenchr. Yes, I think this would bring more clarity for newcomers, as I had to explain this issue many times when teaching :)

One simple way to do it would be to use a similar logic to the array API implementation, before calling `_asarray_with_order`:
https://github.com/data-apis/array-api-compat/blob/main/array_api_compat/common/_helpers.py#L13-L21

Something along the lines of:
```python
is_series = _is_series(array)
...
    array = _asarray_with_order(array, order=order, dtype=dtype, xp=xp)
...
if array.ndim == 1:
    if is_series:
        msg = ...
    else:
        msg = ...
    raise ValueError(msg)
```
with:
```python
def _is_series(array):
    return _is_pandas_series(array)  # this can easily be extended to other series, e.g., polars


def _is_pandas_series(array):
    if "pandas" not in sys.modules:
        return False
    
    import pandas as pd

    return isinstance(array, pd.Series)
```
What do you think?

Labels: Enhancement