code: def test_LabelEncoder_series(self):
      arr = np.array(["X", "Y", "Z", "X"])
      s = pdml.ModelSeries(arr, index=["a", "b", "c", "d"])
  
      mod1 = s.pp.LabelEncoder()
      s.fit(mod1)
      result = s.transform(mod1)
  
      expected = np.array([0, 1, 2, 0])
  
      self.assertIsInstance(result, pdml.ModelSeries)
      self.assert_numpy_array_almost_equal(result.values, expected)
      tm.assert_index_equal(result.index, s.index)
  
      mod1 = s.pp.LabelEncoder()
      result = s.fit_transform(mod1)
  
      self.assertIsInstance(result, pdml.ModelSeries)
      self.assert_numpy_array_almost_equal(result.values, expected)
  
      inversed = result.inverse_transform(mod1)
      self.assertIsInstance(inversed, pdml.ModelSeries)
      tm.assert_series_equal(inversed, s)
  
imports: import pytest
  import numpy
  import pandas
  import sklearn.datasets
  import sklearn.preprocessing
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 20 for calling the TestPreprocessing obj's underlying member method code with example usage: obj.test_LabelEncoder_series() without return types