Purfe

Learn, create and have fun with Python

RSA algorithm in Python

Python implementation of the RSA Encryption Algorithm. Quick reference Generating the keys Encrypting Decrypting Algorithm requirements Generating the keys Choose two prime numbers (p, q), such as p is not equal to q. # TODO implement prime number generator #…

6 ways to solve Fibonacci problem. Python

A Fibonacci sequence is a series of integers where the next number is found by adding up the two numbers before it The formula can be visualised as follows fibonacci(n) = fibonacci(n-1) + fibonacci(n-2) 0, 1, 1, 2, 3, 5,…

Efficient Pandas: ways to save space and time The first step to reduce memory usage is to load only columns that are necessary for analysis by utilizing usecols argument in pd.read_csv(): pd.read_csv(url, usecols=[column names/indexes]). The second – is to specify…

Pytest explained

Quick ref pytest will execute all the files of format test_* or *_test in the current directory and subdirectories. It requires the test function names to start with test. pytest -v for verbose output pytest -q, –quiet less verbose pytest…

How to speak by Patrick Winston

Your ideas are like your children. And you don’t want them to go into the world in rags. You want to be sure that you have these techniques, mechanisms and thoughts about how to present ideas that you have in a way that they’re recognised for the value that is in them.

Jinja templates: Basics

Basic Jinja templates syntax {% … %} Statements. Add control flow and looping inside the templates {{ … }} Expressions. Evaluate expression, variable or function call {# … #} Comments # … ## Line Statements {% raw %} {% endraw…

Plotly Dash essentials

Some useful links for Dash app development Development Plotly graphs Plotly fundamentals Plotly express, plotly express API Basic charts Plotly maps Scatter Plots on Mapbox Styling graphs, styling templates Plotly colorscales Plotly. Discrete colors Dash Plotly graphs in Dash example…

Python Pandas quick reference

This is a working sheet for the Python Pandas library which is commonly used for data manipulation and analysis. Dataset used is FrogID dataset 2.0 Main data structures in Pandas numpy.ndarray is the bedrock data structure on which the Pandas…

Back to top