verticapy.datasets.gen_dataset#
- verticapy.datasets.gen_dataset(features_ranges: dict, nrows: int = 1000) vDataFrame #
Generates a dataset using the input parameters.
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.
- nrows: int, optional
The maximum number of rows in the dataset.
Returns#
- vDataFrame
Generated dataset.
Examples#
import datetime from verticapy.datasets import gen_dataset gen_dataset( features_ranges = { "name": {"type": str, "values": ["Badr", "Badr", "Raghu", "Waqas",]}, "age": {"type": int, "range": [20, 40]}, "distance": {"type": float, "range": [1000, 4000]}, "date": {"type": datetime.date, "range": ["1993-11-03", 365]}, "datetime": {"type": datetime.datetime, "range": ["1993-11-03", 365]}, }, )
AbcnameVarchar(5)123ageInteger123distanceFloat(22)📅dateDate📅datetimeTimestamp(29)1 Raghu 29 2621.5522356797 1994-06-03 1993-11-22 18:06:40.063591 2 Badr 34 3274.91688984446 1994-02-23 1994-04-27 15:20:12.919794 3 Badr 32 1975.77769169584 1993-11-25 1993-12-25 06:28:40.107830 4 Waqas 38 1365.26422598399 1994-05-01 1994-04-03 06:18:58.122272 5 Badr 23 2536.82205616497 1993-12-26 1994-09-07 11:53:50.217234 6 Badr 28 1497.00627010316 1994-03-23 1993-12-15 06:09:04.587149 7 Waqas 26 2795.06066348404 1994-03-23 1994-05-12 18:14:11.706666 8 Raghu 34 2332.27395312861 1994-07-30 1994-05-05 14:40:59.908759 9 Badr 32 2164.63969787583 1994-01-21 1994-07-07 14:31:47.710125 10 Waqas 36 2184.47554507293 1994-03-27 1993-11-30 18:56:37.060049 11 Waqas 25 1433.05784394033 1994-08-27 1994-06-24 16:27:38.017990 12 Raghu 30 2571.38956268318 1994-02-13 1994-06-20 05:55:14.162725 13 Raghu 37 3248.77973599359 1994-07-20 1994-04-08 05:06:01.211995 14 Badr 23 1169.46347150952 1994-08-12 1994-01-30 20:26:52.086180 15 Waqas 27 2860.41634134017 1994-04-20 1993-12-14 09:31:44.114657 16 Waqas 33 2821.07414514758 1994-02-01 1994-10-05 09:32:03.925855 17 Raghu 40 3098.87754986994 1994-06-21 1994-02-17 05:20:44.413099 18 Raghu 33 3103.009742219 1994-05-23 1994-03-17 07:41:52.864590 19 Badr 21 3148.2606891077 1994-02-15 1994-08-12 07:37:50.943996 20 Waqas 24 1522.58338709362 1994-07-26 1994-01-12 14:08:38.280143 21 Badr 33 3352.48589329422 1994-10-29 1994-10-17 23:57:44.632820 22 Badr 28 3899.15024721995 1993-11-08 1993-11-27 20:56:34.093090 23 Waqas 20 3370.13828265481 1993-12-11 1994-02-18 08:25:56.582236 24 Waqas 30 2930.37014547735 1994-08-17 1993-11-24 14:38:47.459507 25 Badr 32 3239.34539686888 1994-09-24 1994-02-21 03:28:23.618862 26 Waqas 23 3196.77351787686 1993-12-24 1993-12-30 11:10:26.561793 27 Waqas 38 3679.8127272632 1994-02-06 1994-03-13 12:34:55.069244 28 Badr 38 1857.41363232955 1994-04-07 1994-07-01 08:43:54.861280 29 Raghu 28 2857.35313361511 1994-01-10 1994-07-09 13:23:58.056540 30 Raghu 34 2826.097703306 1994-02-28 1994-07-23 10:27:20.458138 31 Waqas 21 1485.21666927263 1994-02-05 1994-01-22 20:26:12.888002 32 Badr 32 2986.48276482709 1994-04-13 1994-01-29 04:33:46.197124 33 Waqas 37 1696.3537116535 1994-09-17 1994-05-27 19:54:06.005675 34 Waqas 38 3754.30753990076 1994-03-14 1994-02-27 09:47:42.885558 35 Waqas 24 2536.7723647505 1993-12-31 1994-10-23 12:04:07.676750 36 Badr 27 2278.94618967548 1994-05-08 1993-12-26 05:57:45.419418 37 Waqas 22 1072.29084498249 1994-11-01 1994-02-19 14:36:48.628991 38 Badr 31 3156.57369722612 1994-07-12 1994-04-16 06:52:41.479070 39 Badr 31 3215.23601119407 1994-07-27 1993-12-17 10:59:09.718009 40 Badr 21 3035.5421481654 1993-12-02 1994-05-03 04:03:42.069834 41 Raghu 35 1516.74927445129 1994-09-20 1994-04-03 15:42:41.095925 42 Raghu 36 3352.4865352083 1993-11-12 1994-06-29 10:54:08.354848 43 Raghu 35 3965.42481845245 1994-10-12 1994-02-03 04:24:05.640727 44 Raghu 40 3361.34012928233 1993-11-08 1994-06-23 00:27:26.202457 45 Badr 32 2347.47768612579 1993-12-28 1994-08-27 16:59:45.135499 46 Raghu 33 2137.4571188353 1994-04-18 1994-10-20 23:25:32.132681 47 Badr 31 2503.44728049822 1994-02-03 1994-01-16 08:36:53.811381 48 Raghu 25 3076.19439251721 1994-03-17 1994-02-11 05:05:55.840992 49 Waqas 27 1644.19199246913 1994-10-08 1994-09-19 20:38:37.987360 50 Waqas 25 2821.78880437277 1994-01-25 1994-07-05 03:00:46.904171 51 Waqas 32 1722.20743633807 1994-02-22 1994-02-10 19:17:21.441813 52 Waqas 31 1516.05757814832 1994-03-17 1994-09-22 12:57:14.366586 53 Badr 40 3902.92865550146 1994-06-08 1993-11-18 19:02:26.618544 54 Waqas 20 1606.91472701728 1994-09-18 1994-09-27 12:45:31.490696 55 Waqas 36 3944.13961097598 1994-09-23 1994-08-19 21:07:01.923219 56 Waqas 23 2494.48362085968 1994-08-06 1994-10-19 11:10:39.605919 57 Badr 30 3812.61450517923 1994-05-10 1994-04-12 07:38:48.009508 58 Waqas 38 1255.30303572305 1994-03-31 1994-02-27 14:48:11.819955 59 Badr 27 3180.61227956787 1994-08-30 1994-05-20 05:06:41.031493 60 Raghu 23 3334.38884047791 1994-08-04 1994-05-14 19:59:26.000781 61 Raghu 35 1457.39796734415 1994-02-28 1994-03-28 15:18:29.636810 62 Badr 28 2409.46531412192 1994-10-19 1994-05-24 06:14:00.058389 63 Raghu 34 3657.970367698 1994-05-15 1994-04-14 05:55:12.915035 64 Badr 20 3771.64933294989 1994-02-11 1994-03-08 17:21:00.310377 65 Waqas 29 1015.24575636722 1994-08-05 1994-06-15 01:05:50.649885 66 Badr 28 1642.14780414477 1994-01-18 1994-03-02 21:43:53.042488 67 Waqas 26 3972.74762834422 1994-09-10 1993-12-20 03:43:12.891810 68 Badr 34 1675.61052413657 1994-03-01 1993-12-25 14:25:03.160800 69 Badr 37 1139.21660627238 1994-10-10 1994-04-09 17:49:22.562419 70 Raghu 38 3901.19557408616 1994-09-06 1993-11-18 21:03:03.601921 71 Raghu 29 2789.86535663716 1994-03-24 1994-01-25 10:39:34.199561 72 Waqas 36 1914.24990538508 1994-08-11 1993-12-13 01:52:12.928477 73 Badr 40 2310.22233376279 1993-11-26 1994-09-12 20:41:29.610690 74 Badr 29 2276.12687717192 1993-11-04 1994-01-14 16:01:32.078204 75 Badr 38 3225.69014853798 1994-01-03 1994-04-15 00:17:15.482052 76 Raghu 26 3432.69626353867 1994-06-14 1993-11-30 07:49:14.838797 77 Waqas 25 2022.96311338432 1994-04-16 1994-05-23 23:10:52.570061 78 Badr 31 1395.72031260468 1993-11-26 1994-01-14 11:36:57.961127 79 Badr 30 3178.83110977709 1994-09-03 1994-09-07 07:45:07.635532 80 Badr 39 3602.65820194036 1993-11-16 1994-05-02 03:54:37.235855 81 Badr 30 3321.83841150254 1994-10-15 1994-04-03 09:04:56.657474 82 Badr 36 3265.43152169324 1994-05-03 1994-04-22 22:46:02.813627 83 Badr 24 2695.44378807768 1994-02-15 1994-06-14 03:44:17.006711 84 Raghu 35 1470.43826826848 1994-08-22 1994-02-12 05:30:32.796650 85 Badr 30 1059.92245208472 1994-05-01 1994-09-26 02:46:49.735749 86 Raghu 39 2295.15378829092 1994-03-29 1993-12-28 06:27:57.131438 87 Waqas 25 3643.77962611616 1994-11-01 1994-10-21 15:55:09.285168 88 Raghu 33 2276.18799940683 1994-09-30 1994-09-01 05:43:53.830205 89 Raghu 39 2027.85792062059 1994-03-28 1993-12-25 20:05:57.925934 90 Badr 24 1591.82704635896 1994-01-21 1993-12-14 20:43:56.909871 91 Raghu 23 3758.30214610323 1994-02-21 1993-12-31 18:27:35.721255 92 Waqas 30 3263.51839140989 1994-03-31 1994-01-18 02:29:56.402601 93 Waqas 30 2765.30314213596 1993-12-08 1994-05-14 22:52:23.795427 94 Badr 38 2515.39026666433 1993-12-29 1994-07-21 00:58:08.687977 95 Badr 40 1273.38424813934 1994-03-22 1993-12-27 02:57:37.067442 96 Badr 25 2399.39321903512 1994-08-16 1994-09-02 18:40:15.840246 97 Badr 31 2148.0198528152 1994-03-05 1994-07-05 23:44:37.265918 98 Waqas 34 2436.57154869288 1994-04-16 1994-02-24 22:52:12.864768 99 Badr 31 1625.80327037722 1993-12-24 1994-04-25 09:44:36.765224 100 Raghu 23 2960.52611037157 1994-04-27 1994-11-01 15:49:04.745585 Rows: 1-100 | Columns: 5