[coding] row major vs. column major
numpy 默认 row major c order , PyTorch 默认也是。因为C / C++ 是 row major 添加图片注释,不超过 140 字(可选) 那么 unravel index row = index // cols col = index % cols 假如 import numpy as np np.unravel index
A blog about tools, ideas, and the routines.
numpy 默认 row major c order , PyTorch 默认也是。因为C / C++ 是 row major 添加图片注释,不超过 140 字(可选) 那么 unravel index row = index // cols col = index % cols 假如 import numpy as np np.unravel index
aliasing of mutable objects 在一个 list 里,我们 append 一个 object list= i={1,2} list.append i 之后 query 它,还是 原先的 i list 0 但如果我们在 list 里更改它 list 0 |={5} 原先的 i 也会改变 i return {1,2,5} 解决办法是 li
自定义decorator 格式是: def decorator name func : def wrapper args, kwargs : func args, kwargs other func return results return wrapper 比如下面这个 from fasthtml.common import import numpy as
生成fasta文件 from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio import SeqIO, AlignIO import pandas as pd def get fasta df,seq col='seq',id col='ID',path='out.fasta'