Posts by Rajat Sethi

First Class Functions in Python

A language is set to support first class functions when they can be treated like any other value. You can pass them to functions as arguments, return them from functions, and save them in variables.

First-class functions are important because they’re a basic requirement for writing higher-level abstractions with functions. First class functions are used in various abstractions like closures, decorator and more. First class functions also facilitate metaprogramming.

Read more ...


Pandas cheatsheet

This cheatsheet lists out important and most used pandas functionality.

Pandas input and output functions.

Read more ...


Blogging with Python’s Sphinx

Sphinx is a document generator tool which was originally written for generating Python documentation. Sphinx uses reStructuredText as its markup language but you can write in markdown too.

I have created this blog using Sphinx and its related technologies with inspiration from Predictably Noisy. While there are many static site generators available such as Hugo, Jekyll and others I am familiar with Python’s ecosystem the most which led to my decision of using Sphinx. The bonus is that using myst_nb or nbsphinx Jupyter notebooks can be directly rendered into articles or pages for the website. As per my knowledge none of the other popular static site generators provide ability to render Jupyter notebooks directly into blog posts. In addition to that Sphinx gives you a rich markup to write your articles.

https://www.sphinx-doc.org/en/master/_static/sphinxheader.png

Read more ...