Repository: deepchecks/deepchecks

Issue:
[FEAT] MixedDataTypes to display a few examples of each type
Current display:
![image](https://user-images.githubusercontent.com/33841818/168741336-7c6bdb6c-cb67-4970-a39b-7fcc80dead12.png)

Desired - to see a few unique examples from each type. currently have to inspect column in order to do it, e.g.:
![image](https://user-images.githubusercontent.com/33841818/168741428-87dbe8fb-296f-43a7-b6b1-891d95222049.png)
would want the check to display it by itself



Discussion:
Up to 3 unique values
### Description:
Add another 2 rows to the additional outputs table, one for numeric examples and the other for string examples.
Put up to 3 unique examples.

### Inputs:
No new inputs. the "3 unique examples" thing is a display preference that is really not that interesting to the user and shouldn't be added as a parameter.

### Logic:
Add the needed rows to the _check_mixed_percentage function and it will update the dataframe by itself.

### Tasks:
* Add the needed fields to _check_mixed_percentage - 0.5
* Add test to make sure this works and is covered - 0.5

### Comments:
* Make sure samples are beautified - floats should not have more than 2 decimal points (use format_number) and strings should be cut with "..." if too long (maybe add function to strings.py that does that)

Resolving patch:
diff --git a/deepchecks/tabular/checks/data_integrity/mixed_data_types.py b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
--- a/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
+++ b/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
@@ -18,7 +18,7 @@
 from deepchecks.tabular import Context, SingleDatasetCheck
 from deepchecks.utils.dataframes import select_from_dataframe
 from deepchecks.utils.features import N_TOP_MESSAGE, column_importance_sorter_df
-from deepchecks.utils.strings import format_percent, is_string_column
+from deepchecks.utils.strings import format_list, format_number, format_percent, get_ellipsis, is_string_column
 from deepchecks.utils.typing import Hashable
 
 __all__ = ['MixedDataTypes']
@@ -79,7 +79,13 @@ def run_logic(self, context: Context, dataset_type: str = 'train') -> CheckResul
             result_dict[column_name] = mix
             if mix:
                 # Format percents for display
-                display_dict[column_name] = {k: format_percent(v) for k, v in mix.items()}
+                formated_mix = {}
+                formated_mix['Strings'] = format_percent(mix['strings'])
+                formated_mix['Numbers'] = format_percent(mix['numbers'])
+                formated_mix['Strings examples'] = [get_ellipsis(strr, 15) for strr in mix['strings_examples']]
+                formated_mix['Numbers examples'] = '[' + format_list([format_number(float(num))
+                                                                      for num in mix['numbers_examples']]) + ']'
+                display_dict[column_name] = formated_mix
 
         if display_dict:
             df_graph = pd.DataFrame.from_dict(display_dict)
@@ -91,21 +97,26 @@ def run_logic(self, context: Context, dataset_type: str = 'train') -> CheckResul
 
         return CheckResult(result_dict, display=display)
 
-    @classmethod
-    def _get_data_mix(cls, column_data: pd.Series) -> dict:
+    def _get_data_mix(self, column_data: pd.Series) -> dict:
         if is_string_column(column_data):
-            return cls._check_mixed_percentage(column_data)
+            return self._check_mixed_percentage(column_data)
         return {}
 
-    @classmethod
-    def _check_mixed_percentage(cls, column_data: pd.Series) -> dict:
+    def _check_mixed_percentage(self, column_data: pd.Series) -> dict:
         total_rows = column_data.count()
 
+        numbers_in_col = set()
+        strings_in_col = set()
+
         def is_float(x) -> bool:
             try:
                 float(x)
+                if len(numbers_in_col) < 3:
+                    numbers_in_col.add(x)
                 return True
             except ValueError:
+                if len(strings_in_col) < 3:
+                    strings_in_col.add(x)
                 return False
 
         nums = sum(column_data.apply(is_float))
@@ -116,7 +127,8 @@ def is_float(x) -> bool:
         nums_pct = nums / total_rows
         strs_pct = (np.abs(nums - total_rows)) / total_rows
 
-        return {'strings': strs_pct, 'numbers': nums_pct}
+        return {'strings': strs_pct, 'numbers': nums_pct,
+                'strings_examples': strings_in_col, 'numbers_examples': numbers_in_col}
 
     def add_condition_rare_type_ratio_not_in_range(self, ratio_range: Tuple[float, float] = (0.01, 0.1)):
         """Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the "danger zone".


Test patch:
diff --git a/tests/tabular/checks/integrity/mixed_data_types_test.py b/tests/tabular/checks/integrity/mixed_data_types_test.py
--- a/tests/tabular/checks/integrity/mixed_data_types_test.py
+++ b/tests/tabular/checks/integrity/mixed_data_types_test.py
@@ -199,7 +199,8 @@ def test_mix_nan():
     result = MixedDataTypes().run(dataframe)
     # Assert
     assert_that(result.value, has_entries({
-        'col1': has_entries({'strings': close_to(0.5, 0.01), 'numbers': close_to(0.5, 0.01)}),
+        'col1': has_entries({'strings': close_to(0.5, 0.01), 'numbers': close_to(0.5, 0.01),
+                             'strings_examples': equal_to({'cat'}),
+                             'numbers_examples': equal_to({'1'})}),
         'col2': equal_to({})
     }))
-