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