Each row represents a restaurant bill. https://vincentarelbundock.github.io/Rdatasets/doc/reshape2/tips.html Parameters ---------- pretty_names: bool If True, prettifies the column names return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'} Type of
(pretty_names=False, return_type="pandas")
| 85 | |
| 86 | |
| 87 | def tips(pretty_names=False, return_type="pandas"): |
| 88 | """ |
| 89 | Each row represents a restaurant bill. |
| 90 | |
| 91 | https://vincentarelbundock.github.io/Rdatasets/doc/reshape2/tips.html |
| 92 | |
| 93 | Parameters |
| 94 | ---------- |
| 95 | pretty_names: bool |
| 96 | If True, prettifies the column names |
| 97 | |
| 98 | return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'} |
| 99 | Type of the resulting dataframe |
| 100 | |
| 101 | Returns |
| 102 | ------- |
| 103 | Dataframe of `return_type` type |
| 104 | Dataframe with 244 rows and the following columns: |
| 105 | `['total_bill', 'tip', 'sex', 'smoker', 'day', 'time', 'size']`. |
| 106 | """ |
| 107 | |
| 108 | df = nw.from_native(_get_dataset("tips", return_type=return_type), eager_only=True) |
| 109 | if pretty_names: |
| 110 | df = df.rename( |
| 111 | dict( |
| 112 | total_bill="Total Bill", |
| 113 | tip="Tip", |
| 114 | sex="Payer Gender", |
| 115 | smoker="Smokers at Table", |
| 116 | day="Day of Week", |
| 117 | time="Meal", |
| 118 | size="Party Size", |
| 119 | ) |
| 120 | ) |
| 121 | return df.to_native() |
| 122 | |
| 123 | |
| 124 | def iris(return_type="pandas"): |
nothing calls this directly
no test coverage detected