Article

Definition of standard deviation calculation in pandas and numpy I have been looking up the results of calculating expressions using standard deviation in pandas and numpy, and the results are slightly different, so I made a note of it. github The file in jupyter notebook format on github is here google colaboratory If you want to run it on google colaboratory, here Execution environment !sw_vers ProductName: macOS ProductVersion: 11.6.7 BuildVersion: 20G630 !
Apply filter after groupby in pandas While using pandas, I encountered a situation where I wanted to apply a certain condition after a groupby. I found that I can use groupby.filter(lambda x: x) to apply a filter function. github The file in jupyter notebook format on github is here google colaboratory If you want to run it on google colaboratory, here Execution environment !sw_vers ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G95 !
Use pandas reindex and date_range to fill in missing time series data When analyzing data from e-commerce site sales, there are cases where data for holidays is missing. Since missing dates can be inconvenient when analyzing, pandas reindex and date_range are used to fill in the missing data with some values such as 0. github The file in jupyter notebook format on github is here google colaboratory If you want to run it on google colaboratory, here Execution environment sw_vers ProductName: macOS ProductVersion: 11.
Inverting an array with pytorch I’ve been working with pytorch more and more lately for NLP, and I’d like to write down some things I want to keep in mind. github The file in jupyter notebook format is here google colaboratory To run it in google colaboratory here Author’s environment The author’s OS is macOS, and the options are different from Linux and Unix commands. ! sw_vers ProductName: Mac OS X ProductVersion: 10.
matplotlib template for a graph for a paper Here is my personal template for writing graphs for papers in matplotlib. github The file in jupyter notebook format on github is here . google colaboratory If you want to run it in google colaboratory here Author’s environment sw_vers ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G9323 Python -V Python 3.8.5 %matplotlib inline %config InlineBackend.figure_format = 'svg' import time import json import numpy as np import pandas as pd import matplotlib.
Unpack and assign dictionary type arguments When assigning a large number of arguments at once, it is very convenient to unpack and assign dictionary type arguments. I’ll write it down so I don’t forget. github The file in jupyter notebook format on github is here . google colaboratory If you want to run it on google colaboratory here Author’s environment sw_vers ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G9323 Python -V Python 3.
Python Tips I’ll leave some personal notes on useful notations when using python. github The file in jupyter notebook format on github is here . google colaboratory To run it in google colaboratory here Author’s environment sw_vers ProductName: Mac OS X ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G103 Python -V Python 3.8.5 %matplotlib inline %config InlineBackend.figure_format = 'svg' import time import json import matplotlib.pyplot as plt import numpy as np import pandas as pd import japanize_matplotlib Take the mean and standard deviation of an array with NaN When calculating the mean of an array with NaN, using np.
Python Tips This is my personal memo about useful notations in python. I have not touched on the basics. It is limited to what I find useful. github The jupyter notebook format file on github is here google colaboratory To run it on google colaboratory here Author’s environment ! sw_vers ProductName: Mac OS X ProductVersion: 10.14.6 BuildVersion: 18G95 Python -V Python 3.5.5 :: Anaconda, Inc. %matplotlib inline %config InlineBackend.figure_format = 'svg' import time import json import matplotlib.
Python Tips When I was doing data analysis, I had a chance to use Venn diagrams to visualize the data, so I’m writing this down so I don’t forget. The Venn diagram is a handy tool for visualizing the relationships between datasets, such as duplicates, and is useful in the EDA stage. github The jupyter notebook format file on github is here . google colaboratory If you want to run it on google colaboratory here Author’s environment sw_vers ProductName: Mac OS X ProductVersion: 10.
Cause I had a chance to use a GPU environment on a shared server, but I couldn’t use sudo and had a hard time using basic git and vim, so I wrote it down. It’s hard to implement various source codes on the server without git and vim (vi is included), so I’ll try to get them into the local environment. Environment wget, gcc are included. uname -a Linux ubuntu 5.