pandas Dataredader

What is pandas Datareader It is a library to download data online. Official Documentation Here is a list of data sources. Some require an API key. fred and stooq can obtain data without an API key. Remote Data Access Fred Economic Data Data source provided by the St. Louis Fed. Federal Reserve Economic Data Time Series Graph of Fred NASDAQ Let’s create a time series graph of NASDAQ. Also, let’s display the 200-period moving average SMA200. This can be done in just about 10 lines. ...

September 19, 2021 · 1 min · 195 words · 0xuki

機械学習前処理

前処理 機械学習は前処理が8割と言われます。前処理の手法をまとめました。 欠損値の処理 データの一部数字がblankである場合、該当データを削除、または、代替値で補完します。 どのように欠損値を扱うかがポイントです。 処理としては、fillna,dropnaなどの関数で簡単に対処可能です。 欠損値の確認 df.isnull.sum() 欠損値の対応 平均値で補完 df = df.fillna(df.mean()) 中央値で補完 df = df.fillna(df.mean()) 最煩値で補完 df = df.fillna(df.mode()) 欠損データを削除 dropnaで削除する場合 df = df.dropna() 分類データの処理 アンダーサンプリング 分類を行う際、あるカテゴリのデータのみ件数が多い状況において、 そのカテゴリのデータを削除すること One-Hot-Encoding ダミー変数化 ダミー変数化とは、例えば、企業分類があった場合にそれをカテゴリ毎にゼロイチで表現することです。 分類データ 企業 Amazon Facebook Google One-Hot-Encoding Amazon Facebook Google 1 0 0 0 1 0 0 0 1 Target Encoding 各データをクラス分類してその出現頻度で置き換える方法です。 True/Falseの2値分類であれば、存在確率に置き換わります。 A Class False True False A Class 0.66 0.33 0.66 正規化・標準化 正規化 正規化は最小値を0最大値が1となるようにスケール変換すること。 ただし、外れ値を含む場合は、外れ値を最大値として、0側にデータが偏るため注意が必要。 $ X_{NORM} = \frac{X_i}{X_{max}-X_{min}} $ ...

July 22, 2021 · 1 min · 86 words · 0xuki

ショートカット - Shortcut

OSX/Macショートカットメモ OS全般 Spotlight Search Command + Space 画面ロック Control + Command + q 編集 コピー Command + c ペースト Command + v 書式なしペースト Command + Option + Shift + v orz もとに戻す/Undo Command + z もとに戻すを戻す/Redo Command + Shift + z 画面キャプチャ 矩形画面キャプチャ Command + Shift + 4

June 20, 2021 · 1 min · 48 words · 0xuki

github 備忘・対処メモ

.gitignoreが効かない キャッシュ削除による解決を試みます。 git rm -r --cached . git push がreject ローカルが正/originであることを確認して、強制的にpushします。 git push -f origin master git pull error マージエラーが発生 error: Your local changes to the following files would be overwritten by merge: test.py Please commit your changes or stash them before you merge. Aborting Solve it by overwriting 上書きして解決する場合 pull元が正しい前提で上書きを行います。 git fetch origin master git reset --hard origin/master git pull origin/master sshで2つのgithubアカウントを管理 ~/.ssh/configに2つのアカウントを記載 2つ目をサブに設定 Host github github.com HostName github.com IdentityFile ~/.ssh/rsa-git User git Host github github.com.sub HostName github.com IdentityFile ~/.ssh/rsa-git-sub User git remote URLを以下に設定 ...

June 6, 2021 · 1 min · 168 words · 0xuki

IUT and abc

一般向けIUT・abc予想について。 IUT・abc予想 足し算と掛け算に関わる関係を明らかにする理論と言われます。 また、強いabc予想のもとでは、フェルマーの最終定理が背理法により簡単に導出されます。 ABC予想のよくある間違い https://tsujimotter.hatenablog.com/entry/misunderstanding-of-abc-conjecture ブログ/Web 新一の「心の一票」 - 楽天ブログ https://plaza.rakuten.co.jp/shinichi0329/ 宇宙際タイヒュミラ−理論への誘(いざな)い http://www.kurims.kyoto-u.ac.jp/~motizuki/Uchuusai%20Taihimyuuraa%20riron%20he%20no%20izanai%20(lecture%20note%20ban).pdf 参考書籍 宇宙と宇宙をつなぐ数学 IUT理論の衝撃 (角川学芸出版単行本) https://www.amazon.co.jp/dp/B07QVHZJL8/ref=cm_sw_em_r_mt_dp_P0WNTWA4ZG3RZJ4SE7JB 参考動画 IUT abc Conjecture and New Mathematics - Prof. Fumiharu Kato, Oct 7, 2017 (with English subtitles) abc予想の主張を理解する

February 20, 2021 · 1 min · 36 words · 0xuki

ta-libのインストール

ta-lib Ta-Libはテクニカル分析ライブラリです。 テクニカル教の信者にとってはインストール必須のツールになります。 https://ta-lib.org/ MacOS/OSX ta-libのインストール OSXにインストールする場合はbrewを使うと簡単です。 brew install ta-lib pip3 install TA-Lib Azure ta-libのインストール メモリは1G以上で実行しないとエラーになりました。 ta-libをインストールする際のみ1G以上に変更しましょう。 wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz tar -zxvf ta-lib-0.4.0-src.tar.gz cd ta-lib ./configure --prefix=/usr make sudo make install cd ../ rm -rf ta-lib-0.4.0-src.tar.gz rm -rf ta-lib pip3 install TA-Lib 参考動画

May 1, 2020 · 1 min · 42 words · 0xuki

How to Install Freqtrade: Step-by-Step Guide

📦 Prerequisite: Python Virtual Environment sudo apt-get install python3-venv # Install Python virtual environment 🛠️ Installation Process Clone the Repository 📥 git clone https://github.com/freqtrade/freqtrade.git Enter Directory & Switch Branch 📂 cd freqtrade git checkout develop # Switch to develop branch Run Installation Script ⚙️ ./setup.sh --install ⏳ Important Notes The TA-Lib installation might take 20+ minutes on low-spec systems (tested on Azure 1CPU/1GB RAM) ☁️⏱️ Don’t interrupt the process - just let it run! ☕️ ✅ Completion You’ll see success messages when fully installed! 🎉 Check with freqtrade --version to verify installation ✔️ ...

April 1, 2020 · 1 min · 127 words · 0xuki