MCPcopy Create free account
hub / github.com/dask/dask / digit

Function digit

dask/utils.py:1143–1155  ·  view source on GitHub ↗

>>> digit(1234, 0, 10) 4 >>> digit(1234, 1, 10) 3 >>> digit(1234, 2, 10) 2 >>> digit(1234, 3, 10) 1

(n, k, base)

Source from the content-addressed store, hash-verified

1141
1142
1143def digit(n, k, base):
1144 """
1145
1146 >>> digit(1234, 0, 10)
1147 4
1148 >>> digit(1234, 1, 10)
1149 3
1150 >>> digit(1234, 2, 10)
1151 2
1152 >>> digit(1234, 3, 10)
1153 1
1154 """
1155 return n // base**k % base
1156
1157
1158def insert(tup, loc, val):

Callers 2

groupby_tasksFunction · 0.90
_layerMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected