Skip to content

Instantly share code, notes, and snippets.

💭
We are hiring!

Anand Chitipothu anandology

💭
We are hiring!
Block or report user

Report or block anandology

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@anandology
anandology / plot_decision_boundaries.py
Created Mar 18, 2016
Function to plot the decision boundaries of a scikit-learn classification model.
View plot_decision_boundaries.py
def plot_decision_boundaries(X, y, model_class, **model_params):
"""Function to plot the decision boundaries of a classification model.
This uses just the first two columns of the data for fitting
the model as we need to find the predicted value for every point in
scatter plot.
One possible improvement could be to use all columns fot fitting
and using the first 2 columns and median of all other columns
for predicting.
View stong-weak-primes.py
"""Python is infinitely beautiful!
This program is a response to the post "Infinite work is less work" by
Damian Conway[1].
This program demonstrates how infinity can be handled elegantly in
Python!
THE PROBLEM:
Write a script to generate first 10 strong and weak prime numbers.
@anandology
anandology / parse_voter_rolls.py
Last active May 31, 2019
Script to extract voter info from voter rolls
View parse_voter_rolls.py
"""Script to extract voter info from voter rolls.
This script expects the extracted text file from the voter-list pdf.
It can be done using:
$ pdftotext -layout AC1580002.pdf
"""
import sys
@anandology
anandology / pg-encoding.txt
Created Jul 8, 2013
Fixing PostgreSQL default encoding in Ubuntu
View pg-encoding.txt
# Option 1 - rebuild the cluster
# This will delete alle existing data
pg_dropcluster --stop 9.2 main
pg_createcluster --start -e UTF-8 9.2 main
# Option 2 - rebuild the template1 database
# All the database created after this will have UTF-8 encoding
@anandology
anandology / python-engineer.md
Last active Aug 31, 2018
We are looking for an experienced python engineer to join our team at Rorodata.
View python-engineer.md

We are looking for an experienced python engineer to join our team at Rorodata, a data analytics startup based in Hyderabad. Interesting work in the intersection of data science, infrastructure and microservices.

This is a full-time position based out of Hyderabad. We can explore remote working only in exceptional cases.

Please ping us on rorodata.team@gmail.com if this sounds interesting to you.

About Rorodata

@anandology
anandology / rdash.py
Created Jun 22, 2017
POC implementation of reactive expressions for Dash
View rdash.py
"""Reactive expressions for Dash!
Dash[1] is an interesting project build reactive web applications in Python.
While the ideas are exciting, the syntax for specifying custom code is way
too complicated that it should be.
Here is a sample code to display sum of two input values.
@app.callback(
[Input(component_id='x', component_property='value')]
@anandology
anandology / custom.css
Last active Dec 18, 2017
Custom CSS to optimize jupyter notebook presentation in full-screen when zoomed in
View custom.css
/*
FILE: ~/.jupyter/custom/custom.css
Custom CSS to optimize jupyter notebook presentation in full-screen when zoomed in.
*/
@media all and (max-width: 800px) {
/* Hide prompt when zoomed in */
.prompt {
display: none !important;
}
View fabfile.py
"""Fabric demo.
Setup Instructions:
pip install Fabric3
How to use:
fab --list
fab hello
@anandology
anandology / Makefile
Created Nov 13, 2015
Makefile to export jupyterhub notebooks for all users to html
View Makefile
#
# Makefile to export ipython notebooks in each user home to html
# The output goes to build/$USER/$FILENAME.html
#
SOURCES=$(wildcard /home/*/*.ipynb)
TARGETS=$(shell echo $(SOURCES) | sed -e 's/.ipynb/.html/g' -e 's,/home/,build/,g')
default: $(TARGETS)
debug:
You can’t perform that action at this time.