Python

PyO3でPythonからRustを使う(2: 並列処理)

cargo new --lib word-count Cargo.toml [package] name = "word-count" version = "0.1.0" edition = "2018" #...
プログラミング

PyO3でPythonからRustを使う(1.1)

前回の続きというかやり直し ライブラリを作る cargo new --lib pyo3test Carto.toml に以下を追加 [lib] name = "libname" crate-type = &...
Python

PyO3でPythonからRustを使う

PyO3を試した versionPython: 3.8.10Rust: 1.55.0 OS は Windows ライブラリを作る cargo new --lib addarray Carto.toml に ...
Python

DataFrameの手動ソートのトリック

df.col = df.col.astype("category") df.col.cat.set_categories(sorted_list, inplace=True) df = df.sort_values(["c...
統計学

Pythonでサンプルサイズと検出力

ABテストで使うやつ from __future__ import annotations import math from typing import Tuple import pandas as pd from scipy....
Python

matplotlibの日本語化

import matplotlib from matplotlib import font_manager font_manager.fontManager.addfont("path/to/ipaexg.ttf") matplotli...
Python

pythonでExcel作成

# 桁区切りのカンマありの整数 format_int = {'num_format': '#,##0', 'align': 'right'} # 小数点以下2桁 format_flt = {'num_format': '#,##0.00'...
Python

Pythonのdictの存在しないkey対策

d = {'k0': 'v0', 'k1': 'v1',} # 以下2つは同じで、'v0' を返す d['k0'] d.get('k0') # 以下はエラー d['k2'] # getを使うと、keyが存在しない場...
Python

加算器

Python-likeにかく 半加算器:入力A, B -> 和S, 桁上がりC def HA(A, B): S = XOR(A, B) C = AND(A, B) return S, C 全...
料理

低温調理についてまとめたい

タイトルとURLをコピーしました