Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
We are hiring!

Anand Chitipothu anandology

💭
We are hiring!
View GitHub Profile
@anandology
anandology / cli.md
Last active Apr 3, 2020
Build a CLI application to list the number of covid19 cases and death in India.
View cli.md

Write a CLI application to list the number of covid19 cases and deaths in India.

You can use the following API for getting that data:

https://github.com/anandology/covid19

The required interface is:

$ python covid19.py cases 
STATE CONFIRMED ACTIVE DEATHS
@anandology
anandology / covid19-thehindu.json
Created Mar 25, 2020
The number of COVID19 cases extracted from thehindu.com
View covid19-thehindu.json
{
"india": {
"confirmed": 586,
"active": 534,
"deaths": 10,
"recovered": 42,
"indians": 543,
"foreigners": 43
},
"states": {
@anandology
anandology / custom.css
Created Feb 22, 2020
Custom CSS to optimize the notebook presentation in full-screen when zoomed in
View custom.css
/*
FILE: ~/.jupyter/custom/custom.css
Custom CSS to optimize the notebook presentation in full-screen when zoomed in.
*/
@media all and (max-width: 800px) {
.prompt {
display: none !important;
}
#header-container, #maintoolbar, #menubar {
@anandology
anandology / app_foo.py
Last active Feb 3, 2020
Lazily Load Python Modules
View app_foo.py
# import pandas as pd
from .heavy_modules import pandas as pd
# from google.cloud import bigquery
from .heavy_modules import google_cloud_bigquery as bigquery
def foo(path):
df = pd.read_csv(path)
...
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 / 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 / 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 / top-features.py
Created Mar 15, 2017
Script to find most common features found from multiple runs of an algorithm with different parameters.
View top-features.py
"""Script to find most common features found from
multiple runs of an algorithm with different parameters.
"""
from collections import Counter
runs = [
["a", "b", "c", "d", "e"],
["a", "b", "c", "d", "f"],
["a", "b", "c", "e", "g"],
["a", "b", "d", "f", "h"]
You can’t perform that action at this time.