code: def test_toplevel_impute(self):
      df = pd.DataFrame(
          np.transpose(
              [
                  [0, 1, 2, np.NaN],
                  [1, np.PINF, 2, 3],
                  [1, -3, np.NINF, 3],
              ]
          ),
          columns=["value_a", "value_b", "value_c"],
      )
  
      dataframe_functions.impute(df)
  
      self.assertEqual(list(df.value_a), [0, 1, 2, 1])
      self.assertEqual(list(df.value_b), [1, 3, 2, 3])
      self.assertEqual(list(df.value_c), [1, -3, -3, 3])
  
      df = pd.DataFrame(
          np.transpose(
              [
                  [0, 1, 2, np.NaN],
                  [1, np.PINF, 2, np.NaN],
                  [np.NaN, -3, np.NINF, 3],
              ]
          ),
          columns=["value_a", "value_b", "value_c"],
      )
      df = df.astype(np.float64)
      dataframe_functions.impute(df)
  
      self.assertEqual(list(df.value_a), [0, 1, 2, 1])
      self.assertEqual(list(df.value_b), [1, 2, 2, 1.5])
      self.assertEqual(list(df.value_c), [0, -3, -3, 3])
  
      df = pd.DataFrame(
          np.transpose(
              [
                  [0, 1, 2, np.NaN],
                  [1, np.PINF, 2, 3],
                  [np.PINF, -3, np.NINF, 3],
              ]
          ),
          columns=["value_a", "value_b", "value_c"],
      )
      df = df.astype(np.float32)
      dataframe_functions.impute(df)
  
      self.assertEqual(list(df.value_a), [0, 1, 2, 1])
      self.assertEqual(list(df.value_b), [1, 3, 2, 3])
      self.assertEqual(list(df.value_c), [3, -3, -3, 3])
  
      df = pd.DataFrame([])
      dataframe_functions.impute(df)
  
      self.assertEqual(len(df), 0)
  
imports: import warnings
  from unittest import TestCase
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal, assert_series_equal
  from tests.fixtures import warning_free
  from tsfresh import extract_relevant_features
  from tsfresh.feature_extraction.settings import MinimalFCParameters
  from tsfresh.utilities import dataframe_functions
label_desc: Use image node_id 2 for calling the ImputeTestCase obj's underlying member method code with example usage: obj.test_toplevel_impute() without return types