code: def test_max_n_categories_with_numeric_var(df_enc_numeric):
      # ignore_format=True
      rare_encoder = RareLabelEncoder(
          tol=0.10,
          max_n_categories=2,
          n_categories=1,
          ignore_format=True,
      )
  
      X = rare_encoder.fit_transform(df_enc_numeric[["var_A", "var_B"]])
  
      df = df_enc_numeric[["var_A", "var_B"]].copy()
      df.replace({3: "Rare"}, inplace=True)
  
      # massive workaround because for some reason, doing a normal pd.assert_equal
      # was telling me that 2 columns that were identical, were actually not.
      # I think there was a problem with the type of each number perhaps
      for i in range(len(df)):
          assert str(list(X["var_A"])[i]) == str(list(df["var_A"])[i])
          assert str(list(X["var_B"])[i]) == str(list(df["var_B"])[i])
  
file_path: feature_engine/tests/test_encoding/test_rare_label_encoder.py
imports: import pandas
  import pytest
  from feature_engine.encoding import RareLabelEncoder
label_desc: Use image node_id 9 for calling a global function with example usage: test_max_n_categories_with_numeric_var(df_enc_numeric) without return types