How to Convert an Enum to an Array in TypeScript?

Iterate through a list using range() method in python

As a developer working on a project for a US-based company, I recently faced a situation where I needed to transform a TypeScript enum into an array of objects. In this tutorial, I will explain how to convert an enum to an array in TypeScript. Understanding TypeScript Enums Before we dive into converting an enum … Read more >>

How to Use React Pivot Table

React Pivot Table

I’ve found that nothing satisfies a client quite like a powerful data grid. Whether you are building a FinTech dashboard or a retail inventory tracker, users always want to slice and dice their data. For a long time, I struggled to build custom pivot functionality from scratch using basic HTML tables and complex state management. … Read more >>

TypeScript 2D Arrays: Create, Loop and Type Them with Interfaces

TypeScript 2D array guide: Command Prompt output comparing a fill() grid that shares one row with an Array.from grid

A 2D array in TypeScript is an array of arrays, typed number[][] or Array<Array<number>>. Each inner array is a row, and you read a cell with two indexes, row first: sales[1][2]. The outputs below came straight out of the Windows Command Prompt, compiled with tsc –strict on TypeScript 5.2.2 and Node.js v22.22.2. You’ll build empty … Read more >>

NumPy zeros(): Create Arrays of Zeros with np.zeros

NumPy zeros: Command Prompt showing np.zeros creating 2D and 3D arrays and the shape of np.zeros((3, 2))

np.zeros() creates a NumPy array of a given shape filled with zeros. Pass one number for a 1D array or a tuple for more dimensions, and add dtype if you don’t want floats: Below I cover the shape rules, dtypes, zeros_like(), how it compares with np.empty(), and the errors people hit. Everything ran on Python … Read more >>

How to Check if an Element is Not in a List in Python?

Check if an Element is Not in a List in Python

As a Python developer working on various projects, I came across a scenario where I needed to check whether a specific element was present or not in the list. After researching various methods I found a few important ways to achieve this task. In this article, I will explain how to check if an element … Read more >>

100 Best Python Data Science Interview Questions and Answers (2025)

100 Best Python Data Science Interview Questions and Answers

Python has become a key programming language for data science and machine learning. As more companies seek data scientists, interviews often include Python-focused questions to assess candidates’ skills. These questions cover topics like data manipulation, analysis, visualization, and machine learning using Python libraries. Preparing for Python data science interviews can significantly boost your chances of … Read more >>

How to Convert String to Bytes in Python?

python convert string to bytes

Converting strings to bytes is a common task in Python, especially when dealing with file operations, network communication, or data serialization. As a developer who’s worked with these conversions for years, I will explain various methods to convert string to bytes in Python with examples. If the string holds hex digits like “4a6f”, see convert … Read more >>

Convert String to Variable in Python

Convert String to Variable in Python

In Python, we usually create variables by writing their names directly, like name = “John” or age = 25. But sometimes, you may get variable names from a file, user input, or a form as plain strings like “name” or “age”. In such cases, Python won’t treat these strings as real variables unless you write … Read more >>

Convert String of 1s and 0s to Binary in Python

Convert String of 1s and 0s to Binary in Python

Sometimes in Python, you might come across a string that looks like “101010” just a bunch of 1s and 0s. It looks like binary, but Python treats it as plain text. If you want to use that value as a binary number, for example, to do some math or comparisons, you’ll need to convert it … Read more >>

Convert String to Function in Python

Convert String to Function in Python

Recently, I worked on a project that required me to convert string inputs into executable Python functions. I was building a custom calculator app that would allow users to define their mathematical formulas as text and then use them for calculations. The issue is, there isn’t just one way to do this in Python, and … Read more >>