Skip to content

Instantly share code, notes, and snippets.

View nipunbatra's full-sized avatar

Nipun Batra nipunbatra

View GitHub Profile

These are some of the packages I am using for Python environment in Sublime Text. I'll keep updating this list.

  1. Package control: Makes life easier! Can install a lot of packages using this single package. Much like software center in ubuntu.
  2. Anaconda: This is the master package containing a lot of very useful packages.
  3. Sublime REPL: For running full REPL inside the editor. I love this one, since it allows me to use IPython from within sublime text.
  4. Python breakpoints: For debugging.
length dense sparse
50 0.001299 0.011644
500 0.125389 0.081322
5000 76.505818 4.835517
@nipunbatra
nipunbatra / denoise.py
Created August 2, 2014 19:51
Denoising
from scipy import sparse
from scipy.sparse.linalg import lsqr
import math
import numpy as np
import numpy.linalg.linalg as LA
import time
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("xy.txt", names = ["seq", "col"], sep="],")
df.index = df.seq
df = df.drop("seq",1)
import matplotlib.pyplot as plt
df.head(80).plot(rot=90, kind='bar', width=0.2)
#plt.locator_params(axis ='x',nbins=len(df.index))
labels = df.index.values
plt.gca().set_xticklabels(labels)
plt.tight_layout()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1
\usepackage[hidelinks]{hyperref}
\usepackage{comment}
\usepackage{array}
\usepackage{url}
\usepackage{listings}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{rotating}
\newcommand{\redcolor}[1]{\textcolor{red}{#1}}
\newcommand{\bluecolor}[1]{\textcolor{blue}{#1}}
id a1 b1 c1 a2 b2 c2
1 2 2 2 2 2 2
2 3 4 2 2 2 2
from pymodbus.constants import Endian
from struct import pack, unpack
from pymodbus.constants import Endian
from pymodbus.utilities import pack_bitstring
from pymodbus.utilities import unpack_bitstring
from pymodbus.exceptions import ParameterException
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.transaction import ModbusSocketFramer as ModbusFramer
import datetime
import time
import nilmtk.preprocessing.electricity.building as prepb
import nilmtk.preprocessing.electricity.single as prep
from nilmtk.stats.electricity.building import plot_missing_samples_using_bitmap
from nilmtk.sensors.electricity import Measurement
PATH = "/home/nipun/Dropbox/nilmtk_datasets/iawe"
from nilmtk.dataset import DataSet
import brewer2mpl
set3 = brewer2mpl.get_map('Set3', 'qualitative', 12).mpl_colors
import matplotlib.pyplot as plt