Boilerplate code helpers
utilz.boilerplate
Functions that exist purely to save boilerplate.
randdf(size=(10, 3), columns=None, groups=None, func=None, random_state=None, *args, **kwargs)
Generate a dataframe with random data and alphabetic columns, Default to np.random.randn. Specify another function and size will be passed in as a kwarg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
tuple
|
Defaults to (10,3). |
(10, 3)
|
columns |
list
|
Defaults numbered capital letters like an excel spreadsheet |
None
|
func |
callable
|
function to generate data. Must take a kwarg "size" |
None
|
random_state |
None, int, np.RandomState
|
if None, return the RandomState |
None
|
*args |
any
|
positional arguments to func |
()
|
**kwargs |
any
|
keyword arguments to func |
{}
|
Source code in utilz/boilerplate.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|