data¶
¶
import_data(dataset_path='/home/runner/work/koolsla/koolsla/koolsla/dataset/dish.csv')
¶
Imports dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_path |
str |
Path of dataset file. |
'/home/runner/work/koolsla/koolsla/koolsla/dataset/dish.csv' |
Returns:
Type | Description |
---|---|
DataFrame |
dataset (dataset values): Datas loaded from csv file. |
Source code in koolsla/data.py
23 24 25 26 27 28 29 30 31 32 |
|
list_of_dishes(length)
¶
List the dishes with given length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length |
int |
Length to display dishes. |
required |
Returns:
Type | Description |
---|---|
int |
length (int): Validated length of dishes to display. |
Source code in koolsla/data.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
search_dish(dish_id)
¶
Prints the single dish name with given id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dish_id |
int |
Dish id. |
required |
Returns:
Type | Description |
---|---|
str |
Dish name or None. |
Source code in koolsla/data.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
split_data(dish_dataset)
¶
Splits dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dish_dataset |
Dict |
Dataset. |
required |
Returns:
Type | Description |
---|---|
Dict |
names (dictionary): Dish names in a dictionary. |
Source code in koolsla/data.py
35 36 37 38 39 40 41 42 43 44 45 46 |
|
validate_dish_id(dish_id)
¶
Validates dish id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dish_id |
int |
Dish id. |
required |
Returns:
Type | Description |
---|---|
bool |
is_valid (bool): True / False. |
Source code in koolsla/data.py
49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
validate_length(length)
¶
Validates given length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
length |
int |
Length to display dishes. |
required |
Returns:
Type | Description |
---|---|
bool |
is_valid (bool): True / False. |
Source code in koolsla/data.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
validate_max_recommendation(recommendation_count)
¶
Validates dish id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
recommendation_count |
int |
Max recommendation count given by user. |
required |
Returns:
Type | Description |
---|---|
bool |
is_valid (bool): True / False. |
Source code in koolsla/data.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|