docstr: Test the handle_unknown string  on 'none' and 'na_categorical'.
  The 'handle_missing' must be set to 'return_nan' in order to test
  'handle_unkown' correctly.
docstr_tok: ["Test","the","handle_unknown","string","on","'none","'","and","'na_categorical","'",".","The","'handle_missing","'","must","be","set","to","'return_nan","'","in","order","to","test","'handle_unkown","'","correctly","."]
code: def test_count_handle_unknown_string(self):
      """Test the handle_unknown string  on 'none' and 'na_categorical'.
      The 'handle_missing' must be set to 'return_nan' in order to test
      'handle_unkown' correctly."""
      enc = encoders.CountEncoder(
          handle_missing="return_nan",
          handle_unknown="return_nan",
      )
  
      enc.fit(X)
      out = enc.transform(X_t)
  
      self.assertIn("none", enc._handle_unknown)
      self.assertTrue(pd.Series([6, 5, 3]).isin(out["none"]).all())
      self.assertTrue(out["none"].unique().shape == (4,))
      self.assertTrue(out["none"].isna().sum() == 3)
      self.assertTrue(
          pd.Series([3, 6, 7]).isin(out["na_categorical"]).all()
      )
      self.assertTrue(out["na_categorical"].unique().shape == (4,))
      self.assertTrue(out["na_categorical"].isna().sum() == 3)
  
file_path: category_encoders/tests/test_count.py
imports: import pandas
  from unittest import TestCase
  import numpy
  import category_encoders
label_desc: Use image node_id 4 for calling the TestCountEncoder obj's underlying member method code with example usage: obj.test_count_handle_unknown_string() without return types