class_docstr: Class which contains methods for data preprocessing.
  The class performs two types of preprocessing: obligatory and optional.
  
  obligatory - deletes rows where nans in the target, removes features,
      which full of nans, deletes extra_spaces
  optional - depends on what operations are in the pipeline, gap-filling
      is applied if there is no imputation operation in the pipeline, categorical
      encoding is applied if there is no encoder in the structure of the pipeline etc.
class_docstr_tok: ["Class","which","contains","methods","for","data","preprocessing",".","The","class","performs","two","types","of","preprocessing",":","obligatory","and","optional",".","obligatory","-","deletes","rows","where","nans","in","the","target",",","removes","features",",","which","full","of","nans",",","deletes","extra_spaces","optional","-","depends","on","what","operations","are","in","the","pipeline",",","gap-filling","is","applied","if","there","is","no","imputation","operation","in","the","pipeline",",","categorical","encoding","is","applied","if","there","is","no","encoder","in","the","structure","of","the","pipeline","etc","."]
docstr: Drops rows with nans in target column
  
  Args:
      data: to be modified
  
  Returns:
      modified ``data``
docstr_tok: ["Drops","rows","with","nans","in","target","column","Args",":","data",":","to","be","modified","Returns",":","modified","``","data","``"]
code: def _drop_rows_with_nan_in_target(data: InputData) -> InputData:
      """
      Drops rows with nans in target column
  
      Args:
          data: to be modified
  
      Returns:
          modified ``data``
      """
      features = data.features
      target = data.target
  
      # Find indices of nans rows. Using pd instead of np because it is needed for string columns
      bool_target = np.array(pd.isna(target))
      number_nans_per_rows = bool_target.sum(axis=1)
  
      # Ids of rows which doesn't contain nans in target
      non_nan_row_ids = np.ravel(np.argwhere(number_nans_per_rows == 0))
  
      if len(non_nan_row_ids) == 0:
          raise ValueError(
              "Data contains too much nans in the target column(s)"
          )
      data.features = features[non_nan_row_ids, :]
      data.target = target[non_nan_row_ids, :]
      data.idx = np.array(data.idx)[non_nan_row_ids]
  
      return data
  
imports: from copy import copy
  from typing import Optional, Union
  import numpy
  import pandas
  from golem.core.log import default_log
  from golem.core.paths import copy_doc
  from sklearn.preprocessing import LabelEncoder
  from fedot.core.data.data import InputData, np_datetime_to_numeric
  from fedot.core.data.data import OutputData, data_type_is_table, data_type_is_text, data_type_is_ts
  from fedot.core.data.data_preprocessing import data_has_categorical_features, data_has_missing_values, find_categorical_columns, replace_inf_with_nans, replace_nans_with_empty_strings
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.operations.evaluation.operation_implementations.data_operations.categorical_encoders import LabelEncodingImplementation, OneHotEncodingImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_transformations import ImputationImplementation
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.preprocessing.base_preprocessing import BasePreprocessor
  from fedot.preprocessing.categorical import BinaryCategoricalPreprocessor
  from fedot.preprocessing.data_type_check import exclude_image, exclude_multi_ts, exclude_ts
  from fedot.preprocessing.data_types import TYPE_TO_ID, TableTypesCorrector
  from fedot.preprocessing.structure import DEFAULT_SOURCE_NAME, PipelineStructureExplorer
label_desc: Use image node_id 13 for calling the DataPreprocessor obj's underlying member method code with example usage: obj._drop_rows_with_nan_in_target(data) and returns: data