Utils
tablite.utils
Attributes
tablite.utils.letters = string.ascii_lowercase + string.digits
module-attribute
tablite.utils.NoneType = type(None)
module-attribute
tablite.utils.required_keys = {'min', 'max', 'mean', 'median', 'stdev', 'mode', 'distinct', 'iqr_low', 'iqr_high', 'iqr', 'sum', 'summary type', 'histogram'}
module-attribute
tablite.utils.summary_methods = {bool: _boolean_statistics_summary, int: _numeric_statistics_summary, float: _numeric_statistics_summary, str: _string_statistics_summary, date: _date_statistics_summary, datetime: _datetime_statistics_summary, time: _time_statistics_summary, timedelta: _timedelta_statistics_summary, type(None): _none_type_summary}
module-attribute
Classes
Functions
tablite.utils.generate_random_string(len)
Source code in tablite/utils.py
21 22 |
|
tablite.utils.type_check(var, kind)
Source code in tablite/utils.py
25 26 27 |
|
tablite.utils.sub_cls_check(c, kind)
Source code in tablite/utils.py
30 31 32 |
|
tablite.utils.name_check(options, *names)
Source code in tablite/utils.py
35 36 37 38 |
|
tablite.utils.unique_name(wanted_name, set_of_names)
returns a wanted_name as wanted_name_i given a list of names which guarantees unique naming.
Source code in tablite/utils.py
41 42 43 44 45 46 47 48 49 50 51 52 |
|
tablite.utils.expression_interpreter(expression, columns)
Interprets valid expressions such as:
"all((A==B, C!=4, 200<D))"
as
def _f(A,B,C,D): return all((A==B, C!=4, 200<D))
using python's compiler.
Source code in tablite/utils.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
tablite.utils.intercept(A, B)
Enables calculation of the intercept of two range objects. Used to determine if a datablock contains a slice.
PARAMETER | DESCRIPTION |
---|---|
A |
range
|
B |
range
|
RETURNS | DESCRIPTION |
---|---|
range
|
The intercept of ranges A and B. |
Source code in tablite/utils.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
tablite.utils.summary_statistics(values, counts)
values: any type counts: integer
returns dict with: - min (int/float, length of str, date) - max (int/float, length of str, date) - mean (int/float, length of str, date) - median (int/float, length of str, date) - stdev (int/float, length of str, date) - mode (int/float, length of str, date) - distinct (number of distinct values) - iqr (int/float, length of str, date) - sum (int/float, length of str, date) - histogram (2 arrays: values, count of each values)
Source code in tablite/utils.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
tablite.utils.date_range(start, stop, step)
Source code in tablite/utils.py
401 402 403 404 405 406 407 408 409 |
|
tablite.utils.dict_to_rows(d)
Source code in tablite/utils.py
412 413 414 415 416 417 418 419 420 421 |
|
tablite.utils.calc_col_count(letters: str)
Source code in tablite/utils.py
424 425 426 427 428 429 430 431 432 |
|
tablite.utils.calc_true_dims(sheet)
Source code in tablite/utils.py
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
|
tablite.utils.fixup_worksheet(worksheet)
Source code in tablite/utils.py
461 462 463 464 465 466 467 468 |
|
tablite.utils.update_access_time(path)
Source code in tablite/utils.py
471 472 473 474 |
|
tablite.utils.load_numpy(path)
Source code in tablite/utils.py
477 478 479 480 |
|
tablite.utils.select_type_name(dtypes: dict)
Source code in tablite/utils.py
483 484 485 486 487 488 489 490 491 |
|
tablite.utils.get_predominant_types(table, all_dtypes=None)
Source code in tablite/utils.py
494 495 496 497 498 499 500 501 502 503 |
|
tablite.utils.py_to_nim_encoding(encoding: str) -> str
Source code in tablite/utils.py
506 507 508 509 510 511 512 513 514 |
|
tablite.utils.strip_escape(str_: str) -> str
Source code in tablite/utils.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
|