code: def counter_to_series(counter: Counter) -> pd.Series:
      if not counter:
          return pd.Series([], dtype=object)
  
      counter_as_tuples = counter.most_common()
      items, counts = zip(*counter_as_tuples)
      return pd.Series(counts, index=items)
  
file_path: ydata-profiling/src/ydata_profiling/model/pandas/describe_categorical_pandas.py
imports: import contextlib
  import string
  from collections import Counter
  from typing import List, Tuple
  import numpy
  import pandas
  from ydata_profiling.config import Settings
  from ydata_profiling.model.pandas.imbalance_pandas import column_imbalance_score
  from ydata_profiling.model.pandas.utils_pandas import weighted_median
  from ydata_profiling.model.summary_algorithms import chi_square, describe_categorical_1d, histogram_compute, series_handle_nulls, series_hashable
label_desc: Use image node_id 3 for calling a global function with example usage: counter_to_series(counter) and returns: pd, pd