code: def test_encode_features_drop_first():
      df = pd.DataFrame(
          {"category": ["ao", "b", "c", "d", "e"]}
      ).astype(
          {"category": "category"},
      )
      pd_es = EntitySet("test")
      pd_es.add_dataframe(
          dataframe_name="a",
          dataframe=df,
          index="index",
          make_index=True,
      )
      features, feature_defs = dfs(
          entityset=pd_es,
          target_dataframe_name="a",
          max_depth=1,
      )
      features_enc, _ = encode_features(
          features,
          feature_defs,
          drop_first=True,
          include_unknown=False,
      )
      assert len(features_enc.columns) == 4
  
      features_enc, feature_defs = encode_features(
          features,
          feature_defs,
          top_n=3,
          drop_first=True,
          include_unknown=False,
      )
  
      assert len(features_enc.columns) == 2
  
file_path: featuretools/featuretools/tests/synthesis/test_encode_features.py
imports: import pandas
  import pytest
  from featuretools import EntitySet, calculate_feature_matrix, dfs
  from featuretools.feature_base import Feature, IdentityFeature
  from featuretools.primitives import NMostCommon
  from featuretools.synthesis import encode_features
label_desc: Use image node_id 9 for calling a global function with example usage: test_encode_features_drop_first() without return types