Posts

Showing posts with the label Python getsizeof command

Featured Post

14 Top Data Pipeline Key Terms Explained

Image
 Here are some key terms commonly used in data pipelines 1. Data Sources Definition: Points where data originates (e.g., databases, APIs, files, IoT devices). Examples: Relational databases (PostgreSQL, MySQL), APIs, cloud storage (S3), streaming data (Kafka), and on-premise systems. 2. Data Ingestion Definition: The process of importing or collecting raw data from various sources into a system for processing or storage. Methods: Batch ingestion, real-time/streaming ingestion. 3. Data Transformation Definition: Modifying, cleaning, or enriching data to make it usable for analysis or storage. Examples: Data cleaning (removing duplicates, fixing missing values). Data enrichment (joining with other data sources). ETL (Extract, Transform, Load). ELT (Extract, Load, Transform). 4. Data Storage Definition: Locations where data is stored after ingestion and transformation. Types: Data Lakes: Store raw, unstructured, or semi-structured data (e.g., S3, Azure Data Lake). Data Warehous...

Python 'getsizeof' Command the Real Purpose

Image
Here's a sample python program to get the size of a List array.  Getting the number of elements present in a List is not easy. So how to get this? To do you need the 'getsizeof' command. Import 'sys' Library. You need to import the 'sys' library to use the SIZE commands.  >>> import sys Congrats to you since you have now imported the SYS library. The command name is " getsizeof" . Check the below example. print("An Integer:") i = int(100) print(sys.getsizeof(i)) The result will be: 100 What is the size command?  - is to get the size of elements. It gives the result based on the object you are being used. Suppose, if you use Strings, you will get String length. How to use the  'getsizeof' command? Example:1 print("Empty string:") empty_string = "" print(sys.getsizeof(empty_string)) Example:2 print("A normal string") s = "Hello world" print(sys.getsizeof(s)) Example:3 print("Incr...