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
import polars as pl | |
import numpy as np | |
df = (pl.DataFrame({ | |
"a": np.random.randint(0, 100, int(1e8)) | |
}).groupby("a").agg( | |
pl.col("a").alias("list") | |
)) | |
# prints |
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
size = 10 ** 2 | |
df = pl.DataFrame({ | |
"groupid": [floor(i*0.1)for i in range(size)], | |
"vectors": [[i,i+1,i-1] for i in range(size)], | |
"numbers": [i for i in range(size)] | |
}) | |
print(df) |
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
# | Name | Type 1 | Type 2 | Total | HP | Attack | Defense | Sp. Atk | Sp. Def | Speed | Generation | Legendary | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Bulbasaur | Grass | Poison | 318 | 45 | 49 | 49 | 65 | 65 | 45 | 1 | False | |
2 | Ivysaur | Grass | Poison | 405 | 60 | 62 | 63 | 80 | 80 | 60 | 1 | False | |
3 | Venusaur | Grass | Poison | 525 | 80 | 82 | 83 | 100 | 100 | 80 | 1 | False | |
3 | VenusaurMega Venusaur | Grass | Poison | 625 | 80 | 100 | 123 | 122 | 120 | 80 | 1 | False | |
4 | Charmander | Fire | 309 | 39 | 52 | 43 | 60 | 50 | 65 | 1 | False | ||
5 | Charmeleon | Fire | 405 | 58 | 64 | 58 | 80 | 65 | 80 | 1 | False | ||
6 | Charizard | Fire | Flying | 534 | 78 | 84 | 78 | 109 | 85 | 100 | 1 | False | |
6 | CharizardMega Charizard X | Fire | Dragon | 634 | 78 | 130 | 111 | 130 | 85 | 100 | 1 | False | |
6 | CharizardMega Charizard Y | Fire | Flying | 634 | 78 | 104 | 78 | 159 | 115 | 100 | 1 | False |
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
# $ pip install requests | |
import requests | |
username = "my-username" | |
password = "my-little-secret" | |
r = requests.post( | |
"https://crux-nuclei.com/login", | |
json={"username": username, "password": password}, | |
) | |
ACCESS_TOKEN = r.json()["access_token"] |
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
nodename,batch,timestamp,task,data,in_rows,question,out_rows,out_cols,solution,version,git,fun,run,time_sec,mem_gb,cache,chk,chk_time_sec,comment,on_disk | |
instance-2,,1610130993.9517767,groupby,G1_1e7_1e2_0_0,10000000,sum v1 by id1,100,2,polars,0.4.0,unknown,.groupby,1,0.296,0.855,TRUE,30001016,0.0,,FALSE | |
instance-2,,1610130994.2619028,groupby,G1_1e7_1e2_0_0,10000000,sum v1 by id1,100,2,polars,0.4.0,unknown,.groupby,2,0.287,0.847,TRUE,30001016,0.0,,FALSE | |
instance-2,,1610130994.8431137,groupby,G1_1e7_1e2_0_0,10000000,sum v1 by id1:id2,10000,3,polars,0.4.0,unknown,.groupby,1,0.575,0.92,TRUE,30001016,0.0,,FALSE | |
instance-2,,1610130995.4009216,groupby,G1_1e7_1e2_0_0,10000000,sum v1 by id1:id2,10000,3,polars,0.4.0,unknown,.groupby,2,0.552,0.924,TRUE,30001016,0.0,,FALSE | |
instance-2,,1610130995.930853,groupby,G1_1e7_1e2_0_0,10000000,sum v1 mean v3 by id3,100000,3,polars,0.4.0,unknown,.groupby,1,0.522,0.832,TRUE,[30001016. 5001212.36305564],0.001,,FALSE | |
instance-2,,1610130996.471266,groupby,G1_1e7_1e2_0_0,10000 |
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
git filter-branch --force --index-filter \ | |
"git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" \ | |
--prune-empty --tag-name-filter cat -- --all |
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
""" | |
How to do minibatches for RNNs in pytorch | |
Assume we feed characters to the model and predict the language of the words. | |
""" | |
def prepare_batch(x, y): | |
# determine the maximum word length per batch and zero pad the tensors | |
n_max = max([a.shape[0] for a in x]) |
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
<navigator :navs="[ | |
{name: 'page 1', id: 'link-page1'}, | |
{name: 'page 2', id: 'link-page2'}, | |
{name: 'page 3', id: 'link-page3'}, | |
]" active="link-page1"> | |
</navigator> | |
<div v-show="activePage === 'link-page1'"> | |
<p>Some content</p> | |
</div> |
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
import navigator from './components/navigator.vue' | |
let vm = new Vue({ | |
el: "#app", | |
components: { | |
navigator | |
}, | |
data: { | |
activePage: 'link-page1', | |
}, |
NewerOlder