Skip to content

Instantly share code, notes, and snippets.

View doraneko94's full-sized avatar

Shuntaro Ohno doraneko94

View GitHub Profile
@doraneko94
doraneko94 / TwoWayAnovaRM.py
Created July 5, 2023 07:50
Python Class for repeated measures two-way ANOVA.
import numpy as np
import pandas as pd
from scipy import stats
class TwoWayAnovaRM:
def __init__(self, data: pd.DataFrame, subject, samples: list):
self.data = data
self.subject = subject
@doraneko94
doraneko94 / plot_error_ellipse.py
Last active January 3, 2024 14:39
Demonstration of plotting an error ellipse (probability ellipse) in Python.
from matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np
fig, ax = plt.subplots(1)
ax.set_aspect('equal')
m = np.array([8, 12])
S = np.array([[16, np.sqrt(78)], [np.sqrt(78), 9]])
r = np.random.multivariate_normal(m, S, size=100) # random points to plot
@doraneko94
doraneko94 / watchdog.rs
Created August 30, 2023 21:22
RustでRaspberry Pi PicoのWatchdogタイマを使用するデモ
// This code was inspired by https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/examples/watchdog.rs
#![no_std]
#![no_main]
use panic_halt as _;
use rp2040_hal as hal;
use hal::pac;
use embedded_hal::digital::v2::OutputPin;
@doraneko94
doraneko94 / Pythonを使用した論文図の作成と統計検定.ipynb
Last active November 2, 2024 00:03
Pythonを使用して論文の図を作る人のためのチュートリアルです。データをプロットし、統計検定を行い、有意差を線で表示します。コードについての説明は https://ushitora.net/archives/5158 を参照してください。
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doraneko94
doraneko94 / xy.dart
Last active January 31, 2025 23:27
緯度経度と平面直角座標を相互に変換するDart(Flutter)コード
import 'package:latlong2/latlong.dart';
import 'dart:math';
const f = 298.257222;
const r = 6378137.0;
const m0 = 0.9999;
const n1 = 1 / (2 * f - 1);
const alpha = [
1.0,
0.0008377318250120707,