Loading...

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