tree.export_graphviz numpy error

### Describe the bug

When using tree.export_graphviz in 1.4.2 the following error appears:

```
Traceback (most recent call last):
  File "c:\Users\aller\Desktop\junk\ml_scikitlearn_decision_tree_classification_simple.py", line 39, in <module>
    dot_data = tree.export_graphviz(clf,
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\_param_validation.py", line 213, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\tree\_export.py", line 869, in export_graphviz
    feature_names = check_array(
                    ^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 997, in check_array
    array = _asarray_with_order(array, order=order, dtype=dtype, xp=xp)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\_array_api.py", line 521, in _asarray_with_order
    array = numpy.asarray(array, order=order, dtype=dtype)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
```

The same code works normally in 1.2.2.

### Steps/Code to Reproduce

```py
from sklearn import tree
from sklearn import metrics
import matplotlib.pyplot as plt


data_X = [[0.21, 327],   # 1
          [0.39, 497],   # 1
          [0.50, 1122],  # 2
          [0.76, 907],   # 1
          [0.87, 2757],  # 1
          [0.98, 2865],  # 1
          [1.13, 3045],  # 2
          [1.34, 3914],  # 2
          [1.67, 4849],  # 2
          [1.81, 5688]]  # 2

data_Y = ['1', '1', '2', '1', '1', '1', '2', '2', '2', '2']

test_X = [[0.26, 689],
          [0.41, 880],
          [0.52, 1012],
          [0.76, 907],
          [0.81, 2650],
          [0.9, 2634],
          [1.24, 2999],
          [1.42, 3850],
          [1.61, 4345],
          [1.78, 4100]]

test_y = ['1', '2', '2', '1', '1', '1', '2', '2', '2', '1']

clf = tree.DecisionTreeClassifier()
clf = clf.fit(data_X, data_Y)

prediction = clf.predict(test_X)
print(f'Prediction Accuracy: {metrics.accuracy_score(prediction, test_y) * 100:.4f}%')

dot_data = tree.export_graphviz(clf,
                                feature_names=['carat', ['price']],
                                out_file=None,
                                filled=True,
                                rounded=True)
```

### Expected Results

No error and an export of the decision tree classifier is produced.

### Actual Results

```
Traceback (most recent call last):
  File "c:\Users\aller\Desktop\junk\ml_scikitlearn_decision_tree_classification_simple.py", line 39, in <module>
    dot_data = tree.export_graphviz(clf,
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\_param_validation.py", line 213, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\tree\_export.py", line 869, in export_graphviz
    feature_names = check_array(
                    ^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 997, in check_array
    array = _asarray_with_order(array, order=order, dtype=dtype, xp=xp)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\_array_api.py", line 521, in _asarray_with_order
    array = numpy.asarray(array, order=order, dtype=dtype)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
```

### Versions

```shell
python: 3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
executable: C:\Users\aller\AppData\Local\Programs\Python\Python311\python.exe
   machine: Windows-10-10.0.22631-SP0

Python dependencies:
      sklearn: 1.4.2
          pip: 24.0
   setuptools: 68.2.1
        numpy: 1.24.3
        scipy: 1.10.1
       Cython: None
       pandas: 2.0.0
   matplotlib: 3.7.0
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\.libs\vcomp140.dll
        version: None
    num_threads: 16

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\.libs\libopenblas64__v0.3.21-gcc_10_3_0.dll
        version: 0.3.21
threading_layer: pthreads
   architecture: Haswell
    num_threads: 16

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: C:\Users\aller\AppData\Local\Programs\Python\Python311\Lib\site-packages\scipy.libs\libopenblas-802f9ed1179cb9c9b03d67ff79f48187.dll
        version: 0.3.18
threading_layer: pthreads
   architecture: Prescott
    num_threads: 16
```

COMMENT:
Your snippet runs fine using `feature_names=['carat', 'price']` rather than `feature_names=['carat', ['price']]`. In an ideal world, the error would be clearer ...


```py
dot_data = tree.export_graphviz(clf,
                                feature_names=['carat', 'price'],
                                out_file=None,
                                filled=True,
                                rounded=True)
```

Labels: Bug, Needs Triage