code: def get_counts(series: pd.Series) -> dict:
      # The value_counts() function is used to get a Series containing counts of unique values.
      value_counts_with_nan = series.value_counts(dropna=False)
  
      # Fix for data with only a single value; reset_index was flipping the data returned
      if len(value_counts_with_nan) == 1:
          if pd.isna(value_counts_with_nan.index[0]):
              value_counts_without_nan = pd.Series()
          else:
              value_counts_without_nan = value_counts_with_nan
      else:
          reset_value_counts = value_counts_with_nan.reset_index()
          # Force column naming behavior to be similar for value_counts() being reset between 1.x and 2.x.: make sure col 0 is "index" and 1 is series.name
          # -> This is a no-op in Pandas 1.x
          reset_value_counts.rename(
              columns={
                  reset_value_counts.columns[0]: "index",
                  reset_value_counts.columns[1]: series.name,
              },
              inplace=True,
          )
  
          value_counts_without_nan = (
              reset_value_counts.dropna().set_index("index").iloc[:, 0]
          )
      # print(value_counts_without_nan.index.dtype.name)
  
      # IGNORING NAN FOR NOW AS IT CAUSES ISSUES [FIX]
      # distinct_count_with_nan = value_counts_with_nan.count()
  
      distinct_count_without_nan = value_counts_without_nan.count()
      return {
          "value_counts_without_nan": value_counts_without_nan,
          "distinct_count_without_nan": distinct_count_without_nan,
          "num_rows_with_data": series.count(),
          "num_rows_total": len(series),
          # IGNORING NAN FOR NOW AS IT CAUSES ISSUES [FIX]:
          # "value_counts_with_nan": value_counts_with_nan,
          # "distinct_count_with_nan": distinct_count_with_nan,
      }
  
file_path: sweetviz/sweetviz/series_analyzer.py
imports: import pandas
  from sweetviz.sv_types import NumWithPercent, FeatureType, FeatureToProcess
  from sweetviz.type_detection import determine_feature_type
  import sweetviz.series_analyzer_numeric
  import sweetviz.series_analyzer_cat
  import sweetviz.series_analyzer_text
  from distutils.version import LooseVersion
label_desc: Use image node_id 1 for calling a global function with example usage: get_counts(series) and returns: dict