Skip to content

Instantly share code, notes, and snippets.

View nipunbatra's full-sized avatar

Nipun Batra nipunbatra

View GitHub Profile
Before PR After PR
Screenshot 2022-03-29 at 4 31 53 PM image
(base) ➜  prog-ml.github.io git:(main) ✗ pip install black[jupyter]
zsh: no matches found: black[jupyter]
(base) ➜  prog-ml.github.io git:(main) ✗ black notebooks/introduction/simpson.ipynb 
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install black[jupyter]``
No Python files are present to be formatted. Nothing to do 😴
(base) ➜  prog-ml.github.io git:(main) ✗ which black
/Users/nipun/miniconda3/bin/black
(base) ➜  prog-ml.github.io git:(main) ✗ pip install 'black[jupyter]'              
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nipunbatra
nipunbatra / chunking.ipynb
Created June 14, 2019 09:42
chunking-data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from nilmtk import DataSet
ds = DataSet("/home/nipunbatra-pc/Downloads/iawe.h5")
elec = ds.buildings[1].elec
elec.meters[0].load(chunksize=10)
next(elec.meters[0].load(chunksize=10))
ps aux|grep sparse-transfer-cv-static-matrix.py|awk '{print $2}'|xargs kill -9

We've all seen those weird looking mathematics equations that pop up when we hear about Fourier transforms. In this blog post, we'll programatically try and develop an intuitive understanding into the whole process. While I'll be using the scientific Python stack in this blog post, code in Matlab, R should not be that different.

Goal: Given a time series signal, we'll try and decompose it into various contituent freqencies.

First, let us assume that we are doing some signal acquisition and we can sample at 100 Hz frequency (100 times per second). We collect data for 10 seconds. So, we have a total of 1000 samples.

Samples collection duration (T) = 10s
Sampling frequency (Fs) =100Hz

We've all seen those weird looking mathematics equations that pop up when we hear about Fourier transforms. In this blog post, we'll programatically try and develop an intuitive understanding into the whole process. While I'll be using the scientific Python stack in this blog post, code in Matlab, R should not be that different.

Goal: Given a time series signal, we'll try and decompose it into various contituent freqencies.

First, let us assume that we are doing some signal acquisition and we can sample at 100 Hz frequency (100 times per second). We collect data for 10 seconds. So, we have a total of 1000 samples.

Samples collection duration (T) = 10s
Sampling frequency (Fs) =100Hz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.