Convert A DataFrame To A Nested Dictionary In Python

dataframe to nested dictionary

Recently, I was working on a data analytics project where I needed to convert a Pandas DataFrame into a nested dictionary format for a JSON API endpoint. The challenge was that I needed a specific structure with multiple levels of nesting. Fortunately, Pandas offers several flexible methods to transform DataFrames into nested dictionaries that can … Read more >>

Drop Rows in Python Pandas DataFrames

pandas drop rows

Recently, while I was working on a data analysis project for a US retail company where I needed to clean thousands of customer records. The dataset had numerous missing values, duplicates, and outlier transactions that were skewing our analysis results. The issue was figuring out how to efficiently remove these problematic rows. Pandas, Python’s efficient … Read more >>

Pandas Groupby Without Aggregation Function in Python

pandas groupby without aggregation

Recently, while working on a data analysis project, I needed to group data without performing any aggregation. The issue is, many Python developers only use groupby with aggregation functions like sum(), mean(), or count(). But sometimes you just want to group the data without summarizing it. In this article, I’ll cover several simple ways to … Read more >>

Difference Between Let vs Const in TypeScript

When to Use let and const Variable in TypeScript

When declaring variables in TypeScript, you have three variables: let, const, and var. Understanding these variables is crucial for writing clean, maintainable, and error-free TypeScript code. In this tutorial, we’ll focus on the difference between let vs const in TypeScript, and when to use each one. Understand the let Variable in TypeScript The let the … Read more >>

Difference Between Record vs Object in TypeScript

Difference Between Record vs Object in TypeScript

TypeScript is a powerful language that builds on JavaScript by adding static type definitions. This feature helps developers catch errors early and ensures that their code is more predictable and maintainable. Among the many types available in TypeScript, understanding the difference between Record and Object is essential for every TypeScript developer. This tutorial will learn … Read more >>

How to Get Tomorrow’s Date in TypeScript

calculate tomorrow's date in typescript

While building a minor feature in our internal HR tool, I had to show the date for the next day based on user actions. Since we’re using TypeScript for the frontend, I looked into a few clean and reliable ways to calculate tomorrow’s date. In this tutorial, I’ll explain how to get tomorrow’s date in … Read more >>

Difference Between Enums vs String Literal Unions in TypeScript

TypeScript Enums vs Types Explained with Examples

When working with TypeScript, developers often need to reuse the methods or variables in many places or need clear labels. In TypeScript, String literal unions are simple and best for one-time use cases, and Enums give more structure and are useful when the options are reused in many places or need clear labels. Use string … Read more >>

How to Compare Dates Without Time in TypeScript

compare Dates Without Time in TypeScript

Recently, while working on a TypeScript feature for an internal tool, I needed to compare two dates, but only the date part, not the time. At first, I thought it would be straightforward, but I realised there are multiple ways to do it, and the results can vary depending on the method used. I tried … Read more >>

Read CSV to Dictionary Using Pandas in Python

pandas csv to dict

Working with CSV files is a common task in data analysis and manipulation. While Pandas DataFrames are great for most operations, sometimes you need to convert your CSV data into a Python dictionary for specific use cases. In my decade-plus experience as a Python developer, I’ve found that knowing how to transform CSV data into … Read more >>

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.