code: def test_min_rating_filter():
      python_dataset = pd.DataFrame(
          {
              DEFAULT_USER_COL: [
                  1,
                  2,
                  2,
                  3,
                  3,
                  3,
                  4,
                  4,
                  4,
                  4,
                  5,
                  5,
                  5,
                  5,
                  5,
              ],
              DEFAULT_ITEM_COL: [
                  5,
                  5,
                  5,
                  5,
                  5,
                  4,
                  4,
                  4,
                  4,
                  3,
                  3,
                  3,
                  2,
                  2,
                  1,
              ],
              DEFAULT_RATING_COL: np.random.randint(1, 6, 15),
          }
      )
  
      def count_filtered_rows(data, filter_by="user"):
          split_by_column = (
              DEFAULT_USER_COL
              if filter_by == "user"
              else DEFAULT_ITEM_COL
          )
          data_grouped = data.groupby(split_by_column)
  
          row_counts = []
          for name, group in data_grouped:
              data_group = data_grouped.get_group(name)
              row_counts.append(data_group.shape[0])
  
          return row_counts
  
      df_user = min_rating_filter_pandas(
          python_dataset, min_rating=3, filter_by="user"
      )
      df_item = min_rating_filter_pandas(
          python_dataset, min_rating=2, filter_by="item"
      )
      user_rating_counts = count_filtered_rows(
          df_user, filter_by="user"
      )
      item_rating_counts = count_filtered_rows(
          df_item, filter_by="item"
      )
  
      assert all(u >= 3 for u in user_rating_counts)
      assert all(i >= 2 for i in item_rating_counts)
  
file_path: recommenders/tests/unit/recommenders/datasets/test_python_splitter.py
imports: import pytest
  import pandas
  import numpy
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL
  from recommenders.datasets.split_utils import min_rating_filter_pandas, split_pandas_data_with_ratios
  from recommenders.datasets.python_splitters import python_chrono_split, python_random_split, python_stratified_split, numpy_stratified_split
label_desc: Use image node_id 6 for calling a global function with example usage: test_min_rating_filter() and returns: row_counts