This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import tile, repeat | |
from numpy.random import default_rng | |
from pandas import DataFrame, date_range, Timestamp | |
from pandas.tseries.offsets import Day | |
from random import seed | |
from scipy.stats import zscore | |
from string import ascii_lowercase | |
if __name__ == '__main__': | |
rng = default_rng(s := Timestamp('2021-07-04').asm8.astype('uint32')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import tile, repeat | |
from numpy.random import default_rng | |
from pandas import DataFrame, date_range, Timestamp | |
from pandas.tseries.offsets import Day | |
from random import seed | |
from scipy.stats import zscore | |
from string import ascii_lowercase | |
if __name__ == '__main__': | |
rng = default_rng(s := Timestamp('2021-07-04').asm8.astype('uint32')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from functools import total_ordering | |
from dataclasses import dataclass | |
from numpy import tile, repeat | |
from numpy.random import default_rng | |
from pandas import DataFrame, date_range, Timestamp | |
from pandas.core.dtypes.common import is_numeric_dtype | |
from random import seed | |
from string import ascii_lowercase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! pulse | |
What Does It All | |
<i>Really</i> <b>Mean</b> <i>?</i> | |
! fade | |
What Does It All | |
<i>Really</i> <b>Mean</b> <i>?</i> | |
\ | |
☆ PyCon India ☆ Sat Oct 3, 2020 ☆ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections.abc import Mapping, MutableMapping | |
class cidict(dict): | |
''' a case insensitive, immutable `dict` subclass ''' | |
def __init__(self, *args, **kwargs): | |
super().__init__({k.lower(): v for k, v in dict(*args, **kwargs).items()}) | |
def __missing__(self, key): | |
return self[key.lower()] | |
__setitem__ = __delitem__ = None | |
clear = update = pop = popitem = setdefault = update = None |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3040051 les Escaldes les Escaldes Ehskal'des-Ehndzhordani,Escaldes,Escaldes-Engordany,Les Escaldes,esukarudesu=engorudani jiao qu,lai sai si ka er de-en ge er da,Эскальдес-Энджордани,エスカルデス=エンゴルダニ教区,萊塞斯卡爾德-恩戈爾達,萊塞斯卡爾德-恩戈爾達 42.50729 1.53414 P PPLA AD 08 15853 1033 Europe/Andorra 2008-10-15 | |
3041563 Andorra la Vella Andorra la Vella ALV,Ando-la-Vyey,Andora,Andora la Vela,Andora la Velja,Andora lja Vehl'ja,Andoro Malnova,Andorra,Andorra Tuan,Andorra a Vella,Andorra la Biella,Andorra la Vella,Andorra la Vielha,Andorra-a-Velha,Andorra-la-Vel'ja,Andorra-la-Vielye,Andorre-la-Vieille,Andò-la-Vyèy,Andòrra la Vièlha,an dao er cheng,andolalabeya,andwra la fyla,Ανδόρρα,Андора ла Веля,Андора ла Веља,Андора ля Вэлья,Андорра-ла-Велья,אנדורה לה וולה,أندورا لا فيلا,አንዶራ ላ ቬላ,アンドラ・ラ・ヴェリャ,安道爾城,안도라라베야 42.50779 1.52109 P PPLC AD 07 20430 1037 Europe/Andorra 2010-05-30 | |
290594 Umm al Qaywayn Umm al Qaywayn Oumm al Qaiwain,Oumm al Qaïwaïn,Um al Kawain,Um al Quweim,Umm al Qaiwain,Umm al Qawain,Umm al Qaywayn,Umm al-Quwain,Um |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original attendee solution, PRIOR to refactoring | |
text = ''' | |
I'm not your friend or anything, | |
You think that you're the man | |
I think, therefore, I am | |
I'm not your friend or anything, | |
You think that you're the man | |
I think, therefore, I am |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandas import Series | |
s = Series({ | |
4: 89.00, | |
6: 109.99, | |
8: 149.14, | |
10: 218.99, | |
12: 239.09, | |
14: 279.99, | |
16: 329.99, | |
18: 409.99, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pandas import Series | |
from numpy import repeat | |
from numpy.random import choice | |
from string import ascii_lowercase | |
from time import perf_counter, sleep | |
from contextlib import contextmanager | |
@contextmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from random import randint as python_randint | |
from numpy.random import randint as numpy_randint | |
from numpy import dot as numpy_dot | |
from time import perf_counter | |
from collections import namedtuple | |
from itertools import islice, tee | |
from contextlib import contextmanager |