code: def test_no_index_names_from_order():
      """Test output if no `index` is supplied and column order is maintained."""
      df_in = pd.DataFrame(
          {
              "gender": ["Male", "Female", "Female", "Male", "Male"],
              "contVar": [22379, 24523, 23421, 23831, 29234],
          },
          index=[0, 0, 1, 1, 2],
      )
  
      expected_output = pd.DataFrame(
          {
              "Male": [22379.0, 23831.0, 29234.0],
              "Female": [24523.0, 23421.0, np.nan],
          }
      )
  
      result = (
          df_in.encode_categorical(gender="appearance")
          .reset_index()
          .pivot_wider(
              names_from="gender", values_from="contVar", index="index"
          )
          .set_index("index")
          .rename_axis(index=None)
      )
  
      assert_frame_equal(result, expected_output)
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 23 for calling a global function with example usage: test_no_index_names_from_order() without return types