code: def test_preprocessing_assignment(self):
      iris = datasets.load_iris()
      df = pdml.ModelFrame(iris)
  
      original_columns = df.data.columns
      df["sepal length (cm)"] = df[
          "sepal length (cm)"
      ].preprocessing.binarize(threshold=6)
      self.assertIsInstance(df, pdml.ModelFrame)
      binarized = pp.binarize(
          np.atleast_2d(iris.data[:, 0]), threshold=6
      )
      expected = np.hstack([binarized.T, iris.data[:, 1:]])
      self.assert_numpy_array_almost_equal(df.data.values, expected)
      tm.assert_index_equal(df.data.columns, original_columns)
  
      # recreate data
      iris = datasets.load_iris()
      df = pdml.ModelFrame(iris)
  
      target_columns = ["sepal length (cm)", "sepal width (cm)"]
      df[target_columns] = df[target_columns].preprocessing.binarize(
          threshold=6
      )
      self.assertIsInstance(df, pdml.ModelFrame)
      binarized = pp.binarize(iris.data[:, 0:2], threshold=6)
      expected = np.hstack([binarized, iris.data[:, 2:]])
      self.assert_numpy_array_almost_equal(df.data.values, expected)
      tm.assert_index_equal(df.data.columns, original_columns)
  
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 7 for calling the TestPreprocessing obj's underlying member method code with example usage: obj.test_preprocessing_assignment() without return types