Talip7/scikit-learn-issues-multilabel huggingface dataset:
`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:
Hi @patilniraj8, let's wait for the maintainers' opinion before tackling this issue. Alternatively, you can find other good first issues on skrub, like [this one](https://github.com/skrub-data/skrub/issues/766) if you're interested :)

Labels: Enhancement
`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:
Not sure that at this point of the code, we are aware anymore that you pass a Series. The error is still valid since the main message is: `ValueError: Expected 2D array, got 1D array instead` since this a Series is indeed a 1D vector.

I don't know how much cumbersome is it to track that a conversion happen and avoid/adapt the error message.

Labels: Enhancement
`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:
@Vincent-Maladiere Do you still think it should be improved or can we close?

Labels: Enhancement
`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:
\take

Labels: Enhancement
`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:
Now that we start accepting other dataframe libraries, we might get similar problems with polars, pyarrow, ibis... Ideally I would like to limit the library specific code but I am not sure if there is library agnostic way to detect series-like datastructure using the `__dataframe__` interchange protocol only.

Labels: Enhancement
`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:
I agree. In #27744, we saw that there is a path that lead of Series. So the fix does not introduce new pandas-specific code. However `check_array` probably already do.

Labels: Enhancement
`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:
Also, note that in recent versions of Pandas (from around 1.5) and Polars, series expose the `__column_consortium_standard__` attribute, in the manner of the `__dataframe__` attribute for dataframes.

Labels: Enhancement
Survey: Open-Source Documentation for Newcomers

### Describe the issue linked to the documentation

Hello Scikit-learn Community!

We are researchers from George Mason University in the United States, looking for open-source contributors to participate in our survey on open-source software (OSS) project documentation use when onboarding. If you are 18 or older and contributed to an OSS project in the last one year, you can help!

The objective of our research is to better understand what type of documentation in OSS projects is more helpful for project newcomers. The survey will take approximately 10 minutes, and upon successful completion of the survey, you will be able to participate in a draw for a chance to win one of four Amazon.com gift cards worth $50 via email.

The link to survey: https://go.gmu.edu/Onboarding_Study

We would be greatly appreciative if you would be willing to participate in this study and help us improve the effectiveness of the onboarding to software projects.

If this message would best be directed or reposted somewhere, please let us know, and we will be happy to modify/repost it.

Thank you for considering participating in our research study!

Research Team: Nursena Kurubas, Dr. Kevin Moran and Dr. Brittany Johnson

IRBNet #: 2029296-1

### Suggest a potential alternative/fix

_No response_

COMMENT:
Thanks. For now I'll let this open and will close the issue in a week or so.

Labels: Documentation, good first issue, help wanted
Survey: Open-Source Documentation for Newcomers

### Describe the issue linked to the documentation

Hello Scikit-learn Community!

We are researchers from George Mason University in the United States, looking for open-source contributors to participate in our survey on open-source software (OSS) project documentation use when onboarding. If you are 18 or older and contributed to an OSS project in the last one year, you can help!

The objective of our research is to better understand what type of documentation in OSS projects is more helpful for project newcomers. The survey will take approximately 10 minutes, and upon successful completion of the survey, you will be able to participate in a draw for a chance to win one of four Amazon.com gift cards worth $50 via email.

The link to survey: https://go.gmu.edu/Onboarding_Study

We would be greatly appreciative if you would be willing to participate in this study and help us improve the effectiveness of the onboarding to software projects.

If this message would best be directed or reposted somewhere, please let us know, and we will be happy to modify/repost it.

Thank you for considering participating in our research study!

Research Team: Nursena Kurubas, Dr. Kevin Moran and Dr. Brittany Johnson

IRBNet #: 2029296-1

### Suggest a potential alternative/fix

_No response_

COMMENT:
Just checking in, can this be closed now?

Labels: Documentation, good first issue, help wanted