To start we’re going to create a simple dataframe in python: Shift 1 Row Shift 2 Row Shift Backwards How to fill values Shift to the right or left Coding Interview Example Question Find transactions where person paid more than last time
Python Pandas Explode
Using explode within Python Pnadas allows you to transform each element of a list to a new row within a dataframe. Python Pandas Explode YouTube Video If you want a video demonstration of how the code works, checkout the video below on our YouTube channel. When working with Python Pandas the first step is to […]
Python Pandas GroupBy
Many data analysts begin their journey with SQL, learning how to use GROUP BY to aggregate and summarize data. As they advance, they often transition to Python for more complex data manipulation. One of the key features in Python’s Pandas library is the groupby function, which allows for powerful and flexible data grouping and aggregation. […]
Optuna Hyperparameter Tuning
Optuna is a hyperparameter optimization framework for machine learning models. It can help automate and streamline the process of tuning the hyperparameters. It’s quite popular among Kaggle users and you’ll see it used within competitions. In this article, we will go over an example of using it on a basic dataset. There is also a […]
Ordinal Encoder
When working with real world data, you’ll often have to deal with categorical information. This can be a problem when working with Machine Learning models as most cannot use it. Instead, Data Scientists and Machine Learning engineers need to convert this into a numerical format. This is where the Ordinal Encoder in Scikit-Learn can help. […]
One Hot Encoder
In the realm of machine learning and data science, preparing your data is often as crucial as the modeling itself. One of the essential preprocessing steps when working with categorical data is one-hot encoding. This technique transforms categorical variables into a format that can be provided to machine learning algorithms to improve predictions and insights. […]
Python Match Case Statement
The match case statement in Python introduces a powerful way to handle conditional logic, akin to the switch-case statements found in many other programming languages. By allowing you to match values against a variety of patterns and execute code based on the first pattern that is matched, the match case statement can make your code […]
Chat With a CSV Using LangChain
With just a few lines of code, you can use natural language to chat directly with a CSV file. In this tutorial, I’ll be taking you line by line to achieve results in less than 10 minutes. While still a bit buggy, this is a pretty cool feature to implement in a test tool. It’s […]
LeetCode 182- Duplicate Emails (SQL & Python) Solutions
This article is going to provide the solution to LeetCode 182 Duplicate Emails. It’s an easy difficulty question. Write a solution to report all the duplicate emails. Note that it’s guaranteed that the email field is not NULL. Return the result table in any order. The result format is in the following example. LeetCode Question Link […]
LeetCode 181- Employees Earning More Than Their Managers (SQL & Python) Solutions
This article is going to provide the solution to LeetCode 181 Employees Earning More Than Their Managers. It’s an easy difficulty question. Write a solution to find the employees who earn more than their managers. Return the result table in any order. The result format is in the following example. LeetCode Question Link If you want […]