class_docstr: Gray encoding for categorical variables.
  Gray encoding is a form of binary encoding where consecutive values only differ by a single bit.
  Hence, gray encoding only makes sense for ordinal features.
  This has benefits in privacy preserving data publishing.
  
  Parameters
  ----------
  
  verbose: int
      integer indicating verbosity of the output. 0 for none.
  cols: list
      a list of columns to encode, if None, all string columns will be encoded.
  drop_invariant: bool
      boolean for whether or not to drop columns with 0 variance.
  return_df: bool
      boolean for whether to return a pandas DataFrame from transform (otherwise it will be a numpy array).
  handle_unknown: str
      options are 'error', 'return_nan', 'value', and 'indicator'. The default is 'value'. Warning: if indicator is used,
      an extra column will be added in if the transform matrix has unknown categories.  This can cause
      unexpected changes in dimension in some cases.
  handle_missing: str
      options are 'error', 'return_nan', 'value', and 'indicator'. The default is 'value'. Warning: if indicator is used,
      an extra column will be added in if the transform matrix has nan values.  This can cause
      unexpected changes in dimension in some cases.
  
  Example
  -------
  >>> from category_encoders import GrayEncoder
  >>> import pandas as pd
  >>> from sklearn.datasets import fetch_openml
  >>> bunch = fetch_openml(name="house_prices", as_frame=True)
  >>> display_cols = ["Id", "MSSubClass", "MSZoning", "LotFrontage", "YearBuilt", "Heating", "CentralAir"]
  >>> y = bunch.target
  >>> X = pd.DataFrame(bunch.data, columns=bunch.feature_names)[display_cols]
  >>> enc = GrayEncoder(cols=['CentralAir', 'Heating']).fit(X, y)
  >>> numeric_dataset = enc.transform(X)
  >>> print(numeric_dataset.info())
  <class 'pandas.core.frame.DataFrame'>
  RangeIndex: 1460 entries, 0 to 1459
  Data columns (total 10 columns):
   #   Column        Non-Null Count  Dtype  
  ---  ------        --------------  -----  
   0   Id            1460 non-null   float64
   1   MSSubClass    1460 non-null   float64
   2   MSZoning      1460 non-null   object 
   3   LotFrontage   1201 non-null   float64
   4   YearBuilt     1460 non-null   float64
   5   Heating_0     1460 non-null   int64  
   6   Heating_1     1460 non-null   int64  
   7   Heating_2     1460 non-null   int64  
   8   CentralAir_0  1460 non-null   int64  
   9   CentralAir_1  1460 non-null   int64  
  dtypes: float64(4), int64(5), object(1)
  memory usage: 114.2+ KB
  None
  
  References
  ----------
  
  .. [1] https://en.wikipedia.org/wiki/Gray_code
  .. [2] Jun Zhang, Graham Cormode, Cecilia M. Procopiuc, Divesh Srivastava, and Xiaokui Xiao. 2017. PrivBayes:
  Private Data Release via Bayesian Networks. ACM Trans. Database Syst. 42, 4, Article 25 (October 2017)
code: def gray_code(n, n_bit) -> List[int]:
      gray = n ^ (n >> 1)
      gray_formatted = "{0:0{1}b}".format(gray, n_bit)
      return [int(bit) for bit in gray_formatted]
  
file_path: category_encoders/category_encoders/gray.py
imports: from functools import partialmethod
  import pandas
  from category_encoders import utils
  from category_encoders.basen import BaseNEncoder
  from typing import List
label_desc: Use image node_id 1 for calling the GrayEncoder obj's underlying member method code with example usage: obj.gray_code(n, n_bit) and returns: unknown