df.client_id.value_counts()
df.client_id.value_counts().to_frame(name='count')
new_df.index.name = 'my_index'
new_df.columns = ['count']
list(zip(*[iter(lst)]*2))
img = np.float32(img)
img = img[0::2, :] + img[1::2, :]
img = img[:, 0::2] + img[:, 1::2]
img = np.uint8(img / 4)
img = np.uint8(
(np.float32(img[0::2, 0::2]) + img[0::2, 1::2] + img[1::2, 0::2] + img[1::2, 1::2]) / 4
)
kernel = np.ones((2, 2), dtype=np.float32) / 4
img = cv2.filter2D(img, cv2.CV_8U, kernel, anchor=(0, 0))[::2, ::2]
img = np.lib.stride_tricks.as_strided(
img, (*np.array(img.shape[:2]) // 2, 4, 3), (*np.array(img.strides[:2]) * 2, *img.strides[1:])
).mean(axis=-2).astype(np.uint8)
conda install -c menpo dlib
'ot-2020-01-01.txt' < 'ot-2020-01-02.txt' < 'ot-2020-12-17.txt'
from pathlib import Path
date1 = '2020-11-01'
date2 = '2020-12-17'
files = [path.name for path in Path('path/to/dir').glob('ot-*.txt') if f'ot-{date1}.txt' <= path.name <= f'ot-{date2}.txt']
sum(1 for x in range(a, b + 1) if x ** 3 % 10 in {4, 9})
sum(1 for x in range(a, b + 1) if str(x ** 3).endswith(('4', '9')))