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]}, }, )
AbcnameVarchar(5)123ageInteger123distanceFloat(22)📅datetimeTimestamp(29)1 Raghu 20 1000.0 1993-11-03 00:00:00 2 Raghu 20 1000.0 1993-11-06 15:36:00 3 Raghu 20 1000.0 1993-11-10 07:12:00 4 Raghu 20 1000.0 1993-11-13 22:48:00 5 Raghu 20 1000.0 1993-11-17 14:24:00 6 Raghu 20 1000.0 1993-11-21 06:00:00 7 Raghu 20 1000.0 1993-11-24 21:36:00 8 Raghu 20 1000.0 1993-11-28 13:12:00 9 Raghu 20 1000.0 1993-12-02 04:48:00 10 Raghu 20 1000.0 1993-12-05 20:24:00 11 Raghu 20 1000.0 1993-12-09 12:00:00 12 Raghu 20 1000.0 1993-12-13 03:36:00 13 Raghu 20 1000.0 1993-12-16 19:12:00 14 Raghu 20 1000.0 1993-12-20 10:48:00 15 Raghu 20 1000.0 1993-12-24 02:24:00 16 Raghu 20 1000.0 1993-12-27 18:00:00 17 Raghu 20 1000.0 1993-12-31 09:36:00 18 Raghu 20 1000.0 1994-01-04 01:12:00 19 Raghu 20 1000.0 1994-01-07 16:48:00 20 Raghu 20 1000.0 1994-01-11 08:24:00 21 Raghu 20 1000.0 1994-01-15 00:00:00 22 Raghu 20 1000.0 1994-01-18 15:36:00 23 Raghu 20 1000.0 1994-01-22 07:12:00 24 Raghu 20 1000.0 1994-01-25 22:48:00 25 Raghu 20 1000.0 1994-01-29 14:24:00 26 Raghu 20 1000.0 1994-02-02 06:00:00 27 Raghu 20 1000.0 1994-02-05 21:36:00 28 Raghu 20 1000.0 1994-02-09 13:12:00 29 Raghu 20 1000.0 1994-02-13 04:48:00 30 Raghu 20 1000.0 1994-02-16 20:24:00 31 Raghu 20 1000.0 1994-02-20 12:00:00 32 Raghu 20 1000.0 1994-02-24 03:36:00 33 Raghu 20 1000.0 1994-02-27 19:12:00 34 Raghu 20 1000.0 1994-03-03 10:48:00 35 Raghu 20 1000.0 1994-03-07 02:24:00 36 Raghu 20 1000.0 1994-03-10 18:00:00 37 Raghu 20 1000.0 1994-03-14 09:36:00 38 Raghu 20 1000.0 1994-03-18 01:12:00 39 Raghu 20 1000.0 1994-03-21 16:48:00 40 Raghu 20 1000.0 1994-03-25 08:24:00 41 Raghu 20 1000.0 1994-03-29 00:00:00 42 Raghu 20 1000.0 1994-04-01 15:36:00 43 Raghu 20 1000.0 1994-04-05 07:12:00 44 Raghu 20 1000.0 1994-04-08 22:48:00 45 Raghu 20 1000.0 1994-04-12 14:24:00 46 Raghu 20 1000.0 1994-04-16 06:00:00 47 Raghu 20 1000.0 1994-04-19 21:36:00 48 Raghu 20 1000.0 1994-04-23 13:12:00 49 Raghu 20 1000.0 1994-04-27 04:48:00 50 Raghu 20 1000.0 1994-04-30 20:24:00 51 Raghu 20 1000.0 1994-05-04 12:00:00 52 Raghu 20 1000.0 1994-05-08 03:36:00 53 Raghu 20 1000.0 1994-05-11 19:12:00 54 Raghu 20 1000.0 1994-05-15 10:48:00 55 Raghu 20 1000.0 1994-05-19 02:24:00 56 Raghu 20 1000.0 1994-05-22 18:00:00 57 Raghu 20 1000.0 1994-05-26 09:36:00 58 Raghu 20 1000.0 1994-05-30 01:12:00 59 Raghu 20 1000.0 1994-06-02 16:48:00 60 Raghu 20 1000.0 1994-06-06 08:24:00 61 Raghu 20 1000.0 1994-06-10 00:00:00 62 Raghu 20 1000.0 1994-06-13 15:36:00 63 Raghu 20 1000.0 1994-06-17 07:12:00 64 Raghu 20 1000.0 1994-06-20 22:48:00 65 Raghu 20 1000.0 1994-06-24 14:24:00 66 Raghu 20 1000.0 1994-06-28 06:00:00 67 Raghu 20 1000.0 1994-07-01 21:36:00 68 Raghu 20 1000.0 1994-07-05 13:12:00 69 Raghu 20 1000.0 1994-07-09 04:48:00 70 Raghu 20 1000.0 1994-07-12 20:24:00 71 Raghu 20 1000.0 1994-07-16 12:00:00 72 Raghu 20 1000.0 1994-07-20 03:36:00 73 Raghu 20 1000.0 1994-07-23 19:12:00 74 Raghu 20 1000.0 1994-07-27 10:48:00 75 Raghu 20 1000.0 1994-07-31 02:24:00 76 Raghu 20 1000.0 1994-08-03 18:00:00 77 Raghu 20 1000.0 1994-08-07 09:36:00 78 Raghu 20 1000.0 1994-08-11 01:12:00 79 Raghu 20 1000.0 1994-08-14 16:48:00 80 Raghu 20 1000.0 1994-08-18 08:24:00 81 Raghu 20 1000.0 1994-08-22 00:00:00 82 Raghu 20 1000.0 1994-08-25 15:36:00 83 Raghu 20 1000.0 1994-08-29 07:12:00 84 Raghu 20 1000.0 1994-09-01 22:48:00 85 Raghu 20 1000.0 1994-09-05 14:24:00 86 Raghu 20 1000.0 1994-09-09 06:00:00 87 Raghu 20 1000.0 1994-09-12 21:36:00 88 Raghu 20 1000.0 1994-09-16 13:12:00 89 Raghu 20 1000.0 1994-09-20 04:48:00 90 Raghu 20 1000.0 1994-09-23 20:24:00 91 Raghu 20 1000.0 1994-09-27 12:00:00 92 Raghu 20 1000.0 1994-10-01 03:36:00 93 Raghu 20 1000.0 1994-10-04 19:12:00 94 Raghu 20 1000.0 1994-10-08 10:48:00 95 Raghu 20 1000.0 1994-10-12 02:24:00 96 Raghu 20 1000.0 1994-10-15 18:00:00 97 Raghu 20 1000.0 1994-10-19 09:36:00 98 Raghu 20 1000.0 1994-10-23 01:12:00 99 Raghu 20 1000.0 1994-10-26 16:48:00 100 Raghu 20 1000.0 1994-10-30 08:24:00 Rows: 1-100 | Columns: 4