Skip to content

Instantly share code, notes, and snippets.

View jerilkuriakose's full-sized avatar

Jeril Kuriakose jerilkuriakose

  • Cochin, Kerala, India
View GitHub Profile
# Used to clean and analyse the data-set
import pandas as pd
# To open an excel file
df = pd.ExcelFile('myexcel.xls').parse('Sheet1')
import scipy
import matplotlib.pyplot as plt
import scipy.cluster.hierarchy as sch
# %matplotlib inline
# uncomment the above line if using Jupyter notebook
# creating dummy variable for plotting
# 'D' is a 2-d array that has our data
# for demonstartion purpose we are creating random variables
x = scipy.rand(40)
# Using our context manager
with OpenHDFS(filename) as store:
store.put('d1', df)
from pandas import DataFrame
# import the required library to open HDF file
from pandas import HDFStore
# File that stores the dataframe
filename = 'data.h5'
# Creating a dataframe
df = DataFrame(np.random.randn(5,3), columns=['A', 'B', 'C',])
class OpenHDFS():
a = 25
1
2
5
1
7
9
8
4
6
7
1
2
5
1
2
9
8
4
6
7
@jerilkuriakose
jerilkuriakose / process3dGraph.py
Last active October 19, 2017 09:26 — forked from meganehouser/process3dGraph.py
This is a script which draws the amount of CPU used and memory usage of a process to a 3D graph.
#coding:utf-8
import psutil
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
TIME_NUM = 90
FRAMES = 360
#!/bin/bash
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true
# import the required library to open HDF file
from pandas import HDFStore
class OpenHDFS():
"""
Context Manager class to open / create a HDFS / h5 file
"""
def __init__(self, filename):
"""