This file contains hidden or 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
| set nocompatible | |
| filetype off | |
| set encoding=utf-8 | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'rust-lang/rust.vim' | |
| Plug 'morhetz/gruvbox' | |
| Plug 'itchyny/lightline.vim' | |
| Plug 'preservim/tagbar' |
This file contains hidden or 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
| #%% pairplot / scatter matrix | |
| scatter_cols = ['tilt', 'pitch', 'DCAC ratio','IRR'] | |
| g = sns.pairplot(results.loc[:,scatter_cols + ['Simul.']], hue='Simul.', | |
| x_vars=['IRR','tilt', 'pitch', 'DCAC ratio'], | |
| y_vars=['IRR'], | |
| ) | |
| g.fig.suptitle(site.Site,x=0.05, ha='left',va='top', fontsize=20) | |
| handles = g._legend_data.values() | |
| labels = g._legend_data.keys() | |
| labels = g._legend.remove() |
This file contains hidden or 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
| lambda x: True if x == 0 else False |
This file contains hidden or 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
| from IPython.core.debugger import set_trace | |
| set_trace() |
This file contains hidden or 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 = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Annual'] | |
| num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] | |
| dict(zip(num,name)) |
This file contains hidden or 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
| mask = ~np.in1d(df.index.date, pd.to_datetime(removelist).date) | |
| df = df.loc[mask, :] |
This file contains hidden or 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 matplotlib.dates as mdates | |
| import matplotlib.ticker as mtick | |
| ax.xaxis.set_major_formatter(mdates.DateFormatter("%H:%M")) | |
| ax.yaxis.set_major_formatter(mtick.PercentFormatter()) |
This file contains hidden or 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
| jupyter nbconvert --no-input --to html notebook.ipynb |
This file contains hidden or 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 pandas as pd | |
| df = pd.read_csv("sample.csv", header=[0, 1], index_col=0, sep='\t') | |
| # convert index if required | |
| df.index = pd.to_datetime(df.index) |
This file contains hidden or 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 pickle | |
| # write to file | |
| with open("filename.pkl", "wb") as f: | |
| pickle.dump(data, f) | |
| # read from file | |
| with open("filename.pkl", "rb") as f: | |
| data = pickle.load(f) |
NewerOlder