Matplotlib Color Palette

In this article, we’ll learn how to generate the Matplotlib color palette and then we will use it to select a specific color for our plot. Problem and Solution Overview Problem: When presenting data, the color that you assign to a plot is very important; a bad color choice can make your data difficult to … Read more

Convert CSV to JSON in Python

5 Easy Steps to Convert a CSV to a JSON File You can convert a CSV file to a JSON file by using the following five steps: Import the csv and json libraries Open the CSV as a file object in reading mode using the open(path_to_csv, ‘r’) function in a context manager (=with environment). Load … Read more

Ten Easy Steps to Your First Python Flask App

Project Description Story: Assume you work in the IT Department of Right-On Realtors. Your boss asks you to create a simple website the Realtors can query to view current Home Sales. He would like this website created using the Flask framework in Python. In this article, we’ll create a simple website app to query real estate stats … Read more

Smart Contract Replay Attack in Solidity

This is part 8 and a continuation of the Smart Contract Security Series. Ownership Exploit Private Variable Exploit Reentrancy Attack tx.origin Phishing Attack Denial of Service Attack Storage Collision Attack Randomness Attack Replay Attack This post provides insights into the replay attack in blockchains. As per the wiki, a replay attack is a valid data … Read more

How to Save a Dictionary to a File in Python

Summary: You can use Python’s pickle library to save dictionary data to a file. Another efficient approach to save dictionary data to a file is to use Python’s built-in JSON package. You can also use simple file handling functions to store dictionary data in a text file directly. Problem: Given a Python dictionary. How will … Read more

How to Erase Contents of a File

Problem Formulation and Solution Overview In this article, you’ll learn how to erase the contents of a file in Python. To make it more fun, we have the following running scenario: Let’s say you have a Python script that retrieves the daily stock exchange prices for five (5) Tech Companies and saves it to prices.txt. … Read more

How to Extend a NumPy Array in Python

Summary: Call the append function of the Numpy library as: numpy.append(given_array, elements_to_be_appended, axis) to extend the given array along a specific axis. Other ways of extending the array include using: (i) the vstack and column_stack helper functions. (ii) the numpy.insert function. Problem Formulation Given a Numpy array; How will you extend the given array with … Read more

Top 5 Finance Jobs for Coders in 2024

Coders are often skilled in analytical and creative areas. It doesn’t surprise that with those skills, they often fare well in business and investing too. Examples of skilled coders who are also skilled in finance are Bill Gates, Mark Zuckerberg, Marc Andreessen, and myriads more. Those coders with a strong interest in finance became billionaires! … Read more