I hereby claim:
- I am sainathadapa on github.
- I am sainatha (https://keybase.io/sainatha) on keybase.
- I have a public key ASDDFa8dz4QkhONI4YXDMlAASVaQorpwFcrB-uJbq25wwAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import subprocess | |
import time | |
commands_to_run = ['ls -alh' for _ in range(100)] | |
max_procs = 16 | |
processes = [] | |
while (len(processes) > 0) or (len(commands_to_run) > 0): | |
if (len(processes) < max_procs) & (len(commands_to_run) > 0): |
import json | |
def parse(path): | |
g = open(path, 'r') | |
for l in g: | |
yield json.dumps(eval(l), allow_nan=False, ensure_ascii=True) | |
f = open("kcore_5_strict.json", 'w') | |
for l in parse("kcore_5.json"): | |
f.write(l + '\n') |
import pandas as pd | |
def anti_join(x, y, on): | |
"""Return rows in x which are not present in y""" | |
ans = pd.merge(left=x, right=y, how='left', indicator=True, on=on) | |
ans = ans.loc[ans._merge == 'left_only', :].drop(columns='_merge') | |
return ans | |
def anti_join_all_cols(x, y): |
def glimpse(df, maxvals=10, maxlen=110): | |
print('Shape: ', df.shape) | |
def pad(y): | |
max_len = max([len(x) for x in y]) | |
return [x.ljust(max_len) for x in y] | |
# Column Name | |
toprnt = pad(df.columns.tolist()) | |
--- | |
title: "Search and Download datasets from data.gov.in" | |
author: "Sainath Adapa" | |
date: "25 March 2017" | |
output: | |
ioslides_presentation: | |
highlight: pygments | |
widescreen: yes | |
smaller: true | |
df_print: paged |
library(networkD3) | |
library(magrittr) | |
library(dplyr) | |
library(readr) | |
library(tidyr) | |
tmp <- read_csv('sankey-data.csv', skip = 2) | |
tmp <- tmp[-(21:22),] | |
names(tmp) <- c("X1", "Maharashtra", "Gujarat", "Karnataka", "Andhra Pradesh", | |
"Uttarakhand", "Rajasthan", "Madhya Pradesh", "West Bengal", "Tamil Nadu", |
*.enex |
dualplot <- function(x1, y1, y2, x2 = x1, | |
col = c("#C54E6D", "#009380"), | |
lwd = c(1, 1), colgrid = NULL, | |
mar = c(3, 6, 3, 6) + 0.1, | |
ylab1 = paste(substitute(y1), collapse = ""), | |
ylab2 = paste(substitute(y2), collapse = ""), | |
nxbreaks = 5, | |
yleg1 = paste(gsub("\n$", "", ylab1), "(left axis)"), | |
yleg2 = paste(ylab2, "(right axis)"), | |
ylim1 = NULL, ylim2 = NULL, ylim.ref = NULL, |