Tag: Python
All the articles with the tag "Python".
-
How to Aggregate Values by Date and Sum Them in Python
Problem Statement Suppose you have a list of transactions or events, each associated with a date and a numeric value (e.g., sales amount, transaction amount). Your goal is to aggregate these values by
-
Creating Directories in Python
The os Module Python’s os module provides a way to interact with the operating system. It includes functions for creating, removing, and checking the existence of directories and files. In this
-
Pandas Dataframe: apply method
Calculating Discounts, Taxes, and Total Amount in a DataFrame Suppose you have the following data in a DataFrame: Product Price Category 0 A 100 Electronic 1 B 200 Cloth 2 C 150 Electronic 3 D 300
-
Escape sequences in Pyhon
Escape sequences as in C While reading Automate the Boring Stuff with Python: Practical Programming for Total Beginners, I noticed the existence of raw strings. A raw string is created in such a way
-
Dictionary methods: keys(), values(), and items()
In Python, there are three special methods related to dictionaries that are worth mentioning: keys() , values() , and items() . Interestingly, these methods do not return true lists. They cannot be
-
Sellenium Vs Beautiful Soup
Web scraping is a widely recognized strategy for acquiring information. Before diving into this process, it's crucial to familiarize oneself with two essential tools. Personally, this topic initially
-
Sweetviz error: .iteritems() → .items()
If you install Sweetviz using the command: pip install sweetviz You're going to have this error because change in the Pandas library. So, up to the new release in Sweetviz you can use the following
-
FAKER: Create Unique Random
You have to use: unique.random_int(min=11, max=123) A full example where you can see the creation of a persona is the following: from faker import Faker import pandas as pd fake = Faker() def