parameters: (
          self,
          df: pd.DataFrame,
          features: Optional[Union[Feature, List[Feature]]] = None,
          namespaces: Optional[Union[Namespace, List[Namespace]]] = None,
          label: Optional[
              Union[
                  SimpleLabel,
                  MulticlassLabel,
                  MultiLabel,
                  ContextualbanditLabel,
                  List[MultiLabel],
                  List[ContextualbanditLabel],
              ]
          ] = None,
          tag: Optional[Hashable] = None,
      )
docstring: Initialize a DFtoVW instance.
  
          Args:
              df: The dataframe to convert to VW input format.
              features: One or more Feature object(s).
              namespaces: One or more Namespace object(s), each of being composed of one or
                  more Feature object(s).
              label: One or more label objects used to build the label string
              tag: The tag column name (used as identifiers for examples).
  
          Examples:
              >>> from vowpalwabbit.dftovw import DFtoVW, SimpleLabel, Feature, Namespace
              >>> import pandas as pd
  
              >>> df = pd.DataFrame({"y": [1], "a": [2], "b": [3], "c": [4]})
              >>> conv1 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                features=Feature("a"))
              >>> conv1.convert_df()
              ['1 | a:2']
  
              >>> conv2 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                features=[Feature(col) for col in ["a", "b"]])
              >>> conv2.convert_df()
              ['1 | a:2 b:3']
  
              >>> conv3 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                namespaces=Namespace(
              ...                        name="DoubleIt", value=2,
              ...                        features=Feature(value="a", rename_feature="feat_a")))
              >>> conv3.convert_df()
              ['1 |DoubleIt:2 feat_a:2']
  
              >>> conv4 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                namespaces=[Namespace(name="NS1", features=[Feature(col) for col in ["a", "c"]]),
              ...                            Namespace(name="NS2", features=Feature("b"))])
              >>> conv4.convert_df()
              ['1 |NS1 a:2 c:4 |NS2 b:3']
docstring_summary: Initialize a DFtoVW instance.
docstring_tokens: Initialize a DFtoVW instance .
function: def __init__(
          self,
          df: pd.DataFrame,
          features: Optional[Union[Feature, List[Feature]]] = None,
          namespaces: Optional[Union[Namespace, List[Namespace]]] = None,
          label: Optional[
              Union[
                  SimpleLabel,
                  MulticlassLabel,
                  MultiLabel,
                  ContextualbanditLabel,
                  List[MultiLabel],
                  List[ContextualbanditLabel],
              ]
          ] = None,
          tag: Optional[Hashable] = None,
      ):
          """Initialize a DFtoVW instance.
  
          Args:
              df: The dataframe to convert to VW input format.
              features: One or more Feature object(s).
              namespaces: One or more Namespace object(s), each of being composed of one or
                  more Feature object(s).
              label: One or more label objects used to build the label string
              tag: The tag column name (used as identifiers for examples).
  
          Examples:
              >>> from vowpalwabbit.dftovw import DFtoVW, SimpleLabel, Feature, Namespace
              >>> import pandas as pd
  
              >>> df = pd.DataFrame({"y": [1], "a": [2], "b": [3], "c": [4]})
              >>> conv1 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                features=Feature("a"))
              >>> conv1.convert_df()
              ['1 | a:2']
  
              >>> conv2 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                features=[Feature(col) for col in ["a", "b"]])
              >>> conv2.convert_df()
              ['1 | a:2 b:3']
  
              >>> conv3 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                namespaces=Namespace(
              ...                        name="DoubleIt", value=2,
              ...                        features=Feature(value="a", rename_feature="feat_a")))
              >>> conv3.convert_df()
              ['1 |DoubleIt:2 feat_a:2']
  
              >>> conv4 = DFtoVW(df=df,
              ...                label=SimpleLabel("y"),
              ...                namespaces=[Namespace(name="NS1", features=[Feature(col) for col in ["a", "c"]]),
              ...                            Namespace(name="NS2", features=Feature("b"))])
              >>> conv4.convert_df()
              ['1 |NS1 a:2 c:4 |NS2 b:3']
          """
          self.df = df
          self.n_rows = df.shape[0]
          if isinstance(label, list):
              self.label = _ListLabel(label)
          else:
              self.label = label
          self.tag = _Tag(tag) if tag else None
  
          if label is not None:
              self.check_label_type()
  
          if features is not None:
              self.check_features_type(features)
  
          self.set_namespaces(namespaces, features)
          self.check_namespaces_type()
  
          self.check_missing_columns_df()
          self.check_columns_type_and_values()
function_tokens: def __init__ ( self , df : pd . DataFrame , features : Optional [ Union [ Feature , List [ Feature ] ] ] = None , namespaces : Optional [ Union [ Namespace , List [ Namespace ] ] ] = None , label : Optional [ Union [ SimpleLabel , MulticlassLabel , MultiLabel , ContextualbanditLabel , List [ MultiLabel ] , List [ ContextualbanditLabel ] , ] ] = None , tag : Optional [ Hashable ] = None , ) : self . df = df self . n_rows = df . shape [ 0 ] if isinstance ( label , list ) : self . label = _ListLabel ( label ) else : self . label = label self . tag = _Tag ( tag ) if tag else None if label is not None : self . check_label_type ( ) if features is not None : self . check_features_type ( features ) self . set_namespaces ( namespaces , features ) self . check_namespaces_type ( ) self . check_missing_columns_df ( ) self . check_columns_type_and_values ( )