code: def test_crosstab_with_empties(self):
      # Check handling of empties
      df = DataFrame(
          {
              "a": [1, 2, 2, 2, 2],
              "b": [3, 3, 4, 4, 4],
              "c": [np.nan, np.nan, np.nan, np.nan, np.nan],
          }
      )
  
      empty = DataFrame(
          [[0.0, 0.0], [0.0, 0.0]],
          index=Index([1, 2], name="a", dtype="int64"),
          columns=Index([3, 4], name="b"),
      )
  
      for i in [True, "index", "columns"]:
          calculated = crosstab(
              df.a, df.b, values=df.c, aggfunc="count", normalize=i
          )
          tm.assert_frame_equal(empty, calculated)
  
      nans = DataFrame(
          [[0.0, np.nan], [0.0, 0.0]],
          index=Index([1, 2], name="a", dtype="int64"),
          columns=Index([3, 4], name="b"),
      )
  
      calculated = crosstab(
          df.a, df.b, values=df.c, aggfunc="count", normalize=False
      )
      tm.assert_frame_equal(nans, calculated)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import CategoricalDtype, CategoricalIndex, DataFrame, Index, MultiIndex, Series, crosstab
  import pandas._testing
label_desc: Use image node_id 18 for calling the TestCrosstab obj's underlying member method code with example usage: obj.test_crosstab_with_empties() without return types