code: def test_corner_cases(self):
      sd = idd.MultiData(
          [[1, 2], [3, np.NaN]],
          index=["foo", "bar"],
          columns=["f", "g"],
      )
      print(sd)
  
      self.assertTrue(np.isnan(sd.loc["bar", "g"]))
  
      # support slicing
      print(sd.loc[~sd.loc[:, "g"].isna().data.astype(bool)])
  
      print(
          self.assertTrue(
              idd.SingleData().index == idd.SingleData().index
          )
      )
  
      # empty dict
      print(idd.SingleData({}))
      print(idd.SingleData(pd.Series()))
  
      sd = idd.SingleData()
      with self.assertRaises(KeyError):
          sd.loc["foo"]
  
      # replace
      sd = idd.SingleData([1, 2, 3, 4], index=["foo", "bar", "f", "g"])
      sd = sd.replace(dict(zip(range(1, 5), range(2, 6))))
      print(sd)
      self.assertTrue(sd.iloc[0] == 2)
  
file_path: qlib/tests/misc/test_index_data.py
imports: import numpy
  import pandas
  import qlib.utils.index_data
  import unittest
label_desc: Use image node_id 4 for calling the IndexDataTest obj's underlying member method code with example usage: obj.test_corner_cases() without return types