code: def test_to_scalar_df():
      data = [
          [True, np.array([1, 2, 3]), 42],
          [False, np.array([4, 5, 6]), 28],
          [True, np.array([7, 8, 9]), 99],
      ]
      df = pd.DataFrame(data, columns=["bin", "cat_encoded", "num"])
  
      scalar_data = [
          [True, 1, 2, 3, 42],
          [False, 4, 5, 6, 28],
          [True, 7, 8, 9, 99],
      ]
      expected_df = pd.DataFrame(
          scalar_data,
          columns=[
              "bin",
              "cat_encoded_0",
              "cat_encoded_1",
              "cat_encoded_2",
              "num",
          ],
      )
  
      scalar_df = to_scalar_df(df)
      assert scalar_df.columns.tolist() == expected_df.columns.tolist()
      assert scalar_df.equals(expected_df)
  
file_path: ludwig/tests/ludwig/utils/test_dataframe_utils.py
imports: import numpy
  import pandas
  import pytest
  from ludwig.backend import create_backend, LOCAL_BACKEND
  from ludwig.utils.dataframe_utils import to_numpy_dataset, to_scalar_df
label_desc: Use image node_id 7 for calling a global function with example usage: test_to_scalar_df() without return types