verticapy.datasets.gen_meshgrid¶
- verticapy.datasets.gen_meshgrid(features_ranges: dict) vDataFrame¶
Generates a dataset using regular steps.
Parameters¶
- features_ranges: dict
Dictionary including the features types and ranges.
- For str:
The subdictionary must include two keys: “type” must be set to ‘str’ and ‘value’ must include the feature categories.
- For int:
The subdictionary must include two keys: “type” must be set to ‘int’ and ‘range’ must include two integers that represent the lower and the upper bounds.
- For float:
The subdictionary must include two keys: “type” must be set to ‘float’ and ‘range’ must include two floats that represent the lower and the upper bounds.
- For date:
The subdictionary must include two keys: “type” must be set to ‘date’ and ‘range’ must include the start date and the number of days after.
- For datetime:
The subdictionary must include two keys: “type” must be set to ‘date’ and ‘range’ must include the start date and the number of days after.
Numerical and date-like features must have an extra key in the dictionary named ‘nbins’, which corresponds to the number of bins used to compute the different categories.
Returns¶
- vDataFrame
Generated dataset.
Examples¶
import datetime from verticapy.datasets import gen_meshgrid gen_meshgrid( features_ranges = { "name": {"type": str, "values": ["Badr", "Raghu", "Waqas",]}, "age": {"type": int, "range": [20, 40]}, "distance": {"type": float, "range": [1000, 4000]}, "date": {"type": datetime.date, "range": ["1993-11-03", 365]}, }, )
Abcname123age123distance📅datetime1 Waqas 21 1000.0 1993-11-03 00:00:00 2 Waqas 21 1000.0 1993-11-06 15:36:00 3 Waqas 21 1000.0 1993-11-10 07:12:00 4 Waqas 21 1000.0 1993-11-13 22:48:00 5 Waqas 21 1000.0 1993-11-17 14:24:00 6 Waqas 21 1000.0 1993-11-21 06:00:00 7 Waqas 21 1000.0 1993-11-24 21:36:00 8 Waqas 21 1000.0 1993-11-28 13:12:00 9 Waqas 21 1000.0 1993-12-02 04:48:00 10 Waqas 21 1000.0 1993-12-05 20:24:00 11 Waqas 21 1000.0 1993-12-09 12:00:00 12 Waqas 21 1000.0 1993-12-13 03:36:00 13 Waqas 21 1000.0 1993-12-16 19:12:00 14 Waqas 21 1000.0 1993-12-20 10:48:00 15 Waqas 21 1000.0 1993-12-24 02:24:00 16 Waqas 21 1000.0 1993-12-27 18:00:00 17 Waqas 21 1000.0 1993-12-31 09:36:00 18 Waqas 21 1000.0 1994-01-04 01:12:00 19 Waqas 21 1000.0 1994-01-07 16:48:00 20 Waqas 21 1000.0 1994-01-11 08:24:00 21 Waqas 21 1000.0 1994-01-15 00:00:00 22 Waqas 21 1000.0 1994-01-18 15:36:00 23 Waqas 21 1000.0 1994-01-22 07:12:00 24 Waqas 21 1000.0 1994-01-25 22:48:00 25 Waqas 21 1000.0 1994-01-29 14:24:00 26 Waqas 21 1000.0 1994-02-02 06:00:00 27 Waqas 21 1000.0 1994-02-05 21:36:00 28 Waqas 21 1000.0 1994-02-09 13:12:00 29 Waqas 21 1000.0 1994-02-13 04:48:00 30 Waqas 21 1000.0 1994-02-16 20:24:00 31 Waqas 21 1000.0 1994-02-20 12:00:00 32 Waqas 21 1000.0 1994-02-24 03:36:00 33 Waqas 21 1000.0 1994-02-27 19:12:00 34 Waqas 21 1000.0 1994-03-03 10:48:00 35 Waqas 21 1000.0 1994-03-07 02:24:00 36 Waqas 21 1000.0 1994-03-10 18:00:00 37 Waqas 21 1000.0 1994-03-14 09:36:00 38 Waqas 21 1000.0 1994-03-18 01:12:00 39 Waqas 21 1000.0 1994-03-21 16:48:00 40 Waqas 21 1000.0 1994-03-25 08:24:00 41 Waqas 21 1000.0 1994-03-29 00:00:00 42 Waqas 21 1000.0 1994-04-01 15:36:00 43 Waqas 21 1000.0 1994-04-05 07:12:00 44 Waqas 21 1000.0 1994-04-08 22:48:00 45 Waqas 21 1000.0 1994-04-12 14:24:00 46 Waqas 21 1000.0 1994-04-16 06:00:00 47 Waqas 21 1000.0 1994-04-19 21:36:00 48 Waqas 21 1000.0 1994-04-23 13:12:00 49 Waqas 21 1000.0 1994-04-27 04:48:00 50 Waqas 21 1000.0 1994-04-30 20:24:00 51 Waqas 21 1000.0 1994-05-04 12:00:00 52 Waqas 21 1000.0 1994-05-08 03:36:00 53 Waqas 21 1000.0 1994-05-11 19:12:00 54 Waqas 21 1000.0 1994-05-15 10:48:00 55 Waqas 21 1000.0 1994-05-19 02:24:00 56 Waqas 21 1000.0 1994-05-22 18:00:00 57 Waqas 21 1000.0 1994-05-26 09:36:00 58 Waqas 21 1000.0 1994-05-30 01:12:00 59 Waqas 21 1000.0 1994-06-02 16:48:00 60 Waqas 21 1000.0 1994-06-06 08:24:00 61 Waqas 21 1000.0 1994-06-10 00:00:00 62 Waqas 21 1000.0 1994-06-13 15:36:00 63 Waqas 21 1000.0 1994-06-17 07:12:00 64 Waqas 21 1000.0 1994-06-20 22:48:00 65 Waqas 21 1000.0 1994-06-24 14:24:00 66 Waqas 21 1000.0 1994-06-28 06:00:00 67 Waqas 21 1000.0 1994-07-01 21:36:00 68 Waqas 21 1000.0 1994-07-05 13:12:00 69 Waqas 21 1000.0 1994-07-09 04:48:00 70 Waqas 21 1000.0 1994-07-12 20:24:00 71 Waqas 21 1000.0 1994-07-16 12:00:00 72 Waqas 21 1000.0 1994-07-20 03:36:00 73 Waqas 21 1000.0 1994-07-23 19:12:00 74 Waqas 21 1000.0 1994-07-27 10:48:00 75 Waqas 21 1000.0 1994-07-31 02:24:00 76 Waqas 21 1000.0 1994-08-03 18:00:00 77 Waqas 21 1000.0 1994-08-07 09:36:00 78 Waqas 21 1000.0 1994-08-11 01:12:00 79 Waqas 21 1000.0 1994-08-14 16:48:00 80 Waqas 21 1000.0 1994-08-18 08:24:00 81 Waqas 21 1000.0 1994-08-22 00:00:00 82 Waqas 21 1000.0 1994-08-25 15:36:00 83 Waqas 21 1000.0 1994-08-29 07:12:00 84 Waqas 21 1000.0 1994-09-01 22:48:00 85 Waqas 21 1000.0 1994-09-05 14:24:00 86 Waqas 21 1000.0 1994-09-09 06:00:00 87 Waqas 21 1000.0 1994-09-12 21:36:00 88 Waqas 21 1000.0 1994-09-16 13:12:00 89 Waqas 21 1000.0 1994-09-20 04:48:00 90 Waqas 21 1000.0 1994-09-23 20:24:00 91 Waqas 21 1000.0 1994-09-27 12:00:00 92 Waqas 21 1000.0 1994-10-01 03:36:00 93 Waqas 21 1000.0 1994-10-04 19:12:00 94 Waqas 21 1000.0 1994-10-08 10:48:00 95 Waqas 21 1000.0 1994-10-12 02:24:00 96 Waqas 21 1000.0 1994-10-15 18:00:00 97 Waqas 21 1000.0 1994-10-19 09:36:00 98 Waqas 21 1000.0 1994-10-23 01:12:00 99 Waqas 21 1000.0 1994-10-26 16:48:00 100 Waqas 21 1000.0 1994-10-30 08:24:00 Rows: 1-100 | Columns: 4