Git Jupyterlab Ext

Disclaimer : Extensions in Jupyter-lab are still very much experimental. But this one seems to be working fabulously so far. jupyterlab-git is an extension that lets you stage and commit changes to notebooks made right from within the Jupyterlab interface. This is best installed within the confines of a virtual environment, as is anything experimental. Installation steps - a) Ensure that you have the latest version of jupyterlab (=1.2.0 at the time of this writing) and NodeJS(=12.13.0 at this time) ...

October 31, 2019 · 1 min · Abhiram R

Pandas Notes

These are the commands I use a lot using Pandas - Get rows with NaNs in any column df[df.isna().any(axis=1)] Get dataframe excluding all NaNs in a particular Column df[df['<col_name>'].notnull()] Get counts of number of Nulls per column df.isnull().sum() Increase width of columns displayed in Jupyter Notebooks - This is possibly one of my most used commands for every notebook that involves dataframes. pd.set_option('display.max_colwidth',400)

August 23, 2019 · 1 min · Abhiram R

Podcasts I like

My current regulars Mythology by Parcast Rationally speaking with Julia Galef The Tim Ferriss Show Naval Ravikant Data Stories On Being with Krista Tippett The Python Podcast.__init Akimbo: A Podcast from Seth Godin Outliers Fall of Civilizations My favorite episodes Literary Is the catholic church a force for good - An Intelligence Squared Debate - With Stephen Fry and Christopher Hitchens What makes us human? - with Stephen Fry The Four Horsemen - Richard Dawkins, Daniel Dennet, Christopher Hitchens and Sam Harris The Tim Ferriss Show - with Neil Gaiman Neil Gaiman: How Stories Last Stephen Fry on PG Wodehouse Economics, Psychology, Marketing The Psychology of Advertising with Rory Sutherland Dan Ariely | Payoff Rationally Speaking #178 - Tim Urban on “Trying to live On Data Data Stories : Color with Karen Schloss FlowingData with Nathan Yau Python Podcasts The Real Python Podcast Talk Python To Me Python Bytes Test and Code From Python Import Podcast podcast.init Podcasts by Friends Tales of Time Travel by Gautham Shenoy Kannada Science Fiction by Gautham Shenoy The Forgotten Heritage of the Deccan by Karthik Malli People’s Choice Simblified The Pragati Podcast Paperback The Seen and the Unseen Echoes of India Via Nishant Singh ...

July 8, 2019 · 2 min · Abhiram R

Bangpypers PreWorkshop Setup

A guide to installing a newer version of Python is available here. We at Bangpypers conduct a lot of workshops and some steps are common for all of them. To that end, this post is meant to serve as guide for people to install Python on Ubuntu and Windows (if required), setting up virtualenv and installing the package(s) germane to the corresponding Workshop. Ubuntu Check your existing version of Python to see if you already have what’s required. ...

February 22, 2019 · 2 min · Abhiram R

F U Python Commands

The previous post was for commands Unix. This post is about the Python commands I use or Google frequently. To find the absolute path of the directory of the current file being executed - abs_path = os.path.dirname(os.path.realpath(file)) To copy a file from source to destination (using shutil)- from shutil import copyfile copyfile(src, dst) To copy a file or directory from source to destination (using shutil)- from shutil import copy copy(src, dst) ...

January 9, 2019 · 1 min · Abhiram R

Django Filter To Shorten Naturaltime

This is a filter snippet to shorten the natural time value obtained using naturaltime function from humanize. #In templatetag file , say file_tags.py from django import template register = template.Library() @register.filter def shorten_naturaltime(naturaltime): naturaltime = naturaltime.replace(‘minutes’,’m’).replace(‘hours’,‘h’).replace(‘days’,’d’) naturaltime = naturaltime.replace(‘months’,‘mon’).replace(‘weeks’,‘w’).replace(‘week’,‘w’) return naturaltime #In Usage file {% load file_tags %} {{start_time|naturaltime|shorten_naturaltime}} #where start_time is the datetime object to be modified {% if page.comments %} Please enable JavaScript to view the comments powered by Disqus. ...

June 26, 2018 · 1 min · Abhiram R

Memory Monitor Widget Using Python

I use Ubuntu 16.04 and I’ve been searching for a good memory monitoring desktop widget to no avail. I found a couple of taskbar widgets but none that would tell me the free memory left in addition to the used/swap/cache memories. So I decided to write my own (with loads of help from the Internet of course). Component 1 — The widget I didn’t know how to do this. Thankfully Stuart Langridge had already done this for me. I tweaked the override_background_color parameter to get a red background for my widget and the size of the widget itself to be 400*20 so it would be a nice small strip rather than a big blob of a rectangle. ...

June 5, 2018 · 2 min · Abhiram R

Studying The Show About Nothing

I have watched and re-watched Seinfeld over and over for the last 6–7 years now and it remains, till date, one of my most favorite shows. For a show that claims to be about nothing, it has certainly managed to fill up nine seasons worth of content, all with seemingly no plot. The show, if you’re unfamiliar with it, traces the day-to-day lives of (mainly) 4 quite unremarkable people — Jerry Seinfeld, George Costanza, Cosmo Kramer and Elaine Benes. These 4, along with plenty of other side characters and guest stars engage in what seems to be a series of meaningless conversations and activities, which somehow all come together towards the end of the duration of each episode. ...

February 12, 2018 · 6 min · Abhiram R

Data Visualization Exp2

Alright. Round 2 . FIGHT! So, the last time, I figured out, unintentionally, at what times of the day most of my posts happened. This time, I again unintentionally got results different from what I set out to do — I’ll get to this eventually I guess, but for now, the objective is obtaining a measure of the number of posts I make per day and thereby see if I can figure out which days of the week have been the most (least?) productive. Of course, this is still a step away from my eventual goal (hopefully Experiment 3 should sort it out). Let’s get to the methodology — ...

November 27, 2017 · 8 min · Abhiram R

Data Visualization Exp1

Hours of max FB Usage — I originally intended to do something else, but ended up doing this instead — Figuring out at what hours during the day I’ve been most active on Facebook — outliers included. How? Downloaded my entire Facebook data - This can be done using the Facebook APIs or using the less painful way — requesting for a copy of your Facebook data as a zip file from your Settings panel. ...

September 27, 2017 · 3 min · Abhiram R