Convert Number to Date in TypeScript

Convert Number to Date in TypeScript with Unixtime stamp

When I was working on a TypeScript project recently, I got a requirement to show dates from a system that sent me big numbers like 1623456789000. These numbers are called timestamps, and they represent a date and time, but in a format that’s hard to read. In this blog, I will show you how to … Read more >>

How to Round to 2 Decimals in TypeScript (Without the 1.005 Bug)

Round to 2 decimals in TypeScript: Command Prompt output of a roundTo helper fixing 1.005 and 4.015

The quickest way to round to 2 decimals in TypeScript is Math.round(value * 100) / 100, which returns a number. It breaks on halfway values like 1.005, though, so when every cent matters, shift the decimal point with exponent notation instead: I ran every snippet through TypeScript 7.0.2 and Node.js v22.22.2 in strict mode, so … Read more >>

Linear Search vs Binary Search in Python

Linear Search vs Binary Search Python

When your Python list grows from 10 items to 10 million, the search algorithm you choose starts to matter a lot. In this tutorial, you’ll learn the difference between linear search and binary search in Python, see how each works step by step, and measure how fast they are on real examples. By the end, … Read more >>

Priority Queue in Python

Priority Queue Python

When I first started programming with Python over a decade ago, one of the data structures that immediately stood out for its efficiency and versatility was the priority queue. Whether you’re managing tasks, scheduling jobs, or handling real-time events, priority queues help you process items based on their importance rather than just arrival order. In … Read more >>

What Does in Mean in Python? (in and not in Explained)

What does in mean in Python: Command Prompt output of in and not in membership tests

So what does in mean in Python? It’s the membership operator: x in y asks whether x is inside y and gives back True or False. Its opposite, not in, returns the reverse: Screenshots here are real runs of Python 3.12.5 in the Windows Command Prompt, so the output is exactly what you’ll get. Below … Read more >>

Does Not Equal in Python: The != Operator Explained

Does not equal in Python: Command Prompt output of the != operator on numbers and strings

Does not equal in Python is written as !=. It compares two values and returns True when they’re different and False when they’re the same: For this one I used Python 3.12.5 on a Windows laptop, and the screenshots show the scripts running in Command Prompt. I’ll cover how != treats numbers and strings, when … Read more >>

Python Increment and Decrement: There Is No ++ Operator

Python increment operators: the Command Prompt showing that plus plus x compiles to two no-op unary plus instructions

Python has no increment or decrement operators. There is no ++ and no –. You use augmented assignment instead: The dangerous part is that ++count does not raise an error. It’s valid Python that does absolutely nothing, so the bug is silent. Every result on this page comes from running the code on Python 3.12.5. … Read more >>

How to Use the Pandas Core Series

Use the Pandas Core Series

In my years of developing data pipelines, I’ve found that many people jump straight into DataFrames without truly mastering the Series. The pandas.core.series.Series is actually the backbone of almost every operation you perform in the library. I remember struggling with alignment issues early in my career, only to realize I didn’t understand how the Series … Read more >>

How to Sort by Column in Pandas

Sort by Column in Pandas

Sorting data is one of those fundamental tasks I find myself doing almost every single day when working with Python. Whether I’m analyzing sales performance across different US states or organizing a list of tech employees by their hire dates, getting the order right is the first step toward finding insights. In this guide, I … Read more >>

How to Use loc in Pandas

loc in Pandas

I have spent over a decade building data-driven applications in Python. During that time, I’ve found that the loc property is the most versatile tool in the Pandas library. It is the primary way to access, filter, and even update your data using labels. If you are still struggling with data selection, this guide will … Read more >>