Geek Logbook

Tech sea log book

How to Insert a New Row in a Pandas DataFrame

Working with data often involves modifying it to suit your analysis needs. One common operation is inserting a new row into a DataFrame. In this post, we’ll explore several methods to achieve this in pandas, a powerful data manipulation library in Python. Method 1: Using append() The append() method is straightforward and easy to use

Loading JSON Data into a pandas DataFrame with Python

In this post, we will walk through the process of loading JSON data into a pandas DataFrame using Python. JSON (JavaScript Object Notation) is a popular data format for exchanging data between a server and a web application. Pandas, a powerful data manipulation library in Python, makes it easy to work with JSON data. Step-by-Step

Leveraging SQL Window Functions with PARTITION BY

SQL window functions are a powerful tool for performing calculations across a set of rows related to the current row. When combined with the PARTITION BY clause, these functions can provide deep insights into your data by breaking it into partitions, allowing you to perform calculations within each partition separately. In this post, we will

How to Select Specific Rows from a DataFrame in Python

When working with DataFrames in Python, you may encounter situations where you need to filter and select specific rows based on certain conditions. In this blog post, we will explore how to create a new DataFrame that includes rows with specific criteria. We will also cover how to handle rows with missing values. Problem Statement

Extracting Substrings from Strings in SQL Server

When working with SQL Server databases, you may often encounter scenarios where you need to extract specific parts of a string based on a pattern. A common requirement is to retrieve the substring that follows the last underscore (_) in a given string. This blog post will demonstrate how to achieve this using SQL Server

Loading JSON Data into a Pandas DataFrame

When working with data, it’s common to encounter various file formats. JSON (JavaScript Object Notation) is a popular format for data exchange due to its readability and ease of use. In this post, we’ll explore how to load JSON data into a pandas DataFrame for further analysis. Let’s assume we have a JSON file, data.json,