Posts

Showing posts with the label python-file-methods

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...

6 Python file Methods Real Usage

Image
Files always have data in them. For different purposes, you need methods to deal with them. These six file methods of use in this case. Related:  5 top file modes in python. Python file methods Below are the top six file methods in python: Tell() Seek() Flush() Fileno() truncate() isatty() 1. tell() The usage of tell method is it  returns the cursor-position of the file-pointer from the beginning of the file. It tells the current cursor position. The position starts from zero, which is same as of an index. Syntax:  fileobject.tell() 2. seek() The usage of seek  method is cursor position, from one position to the specified position from the beginning of the file, it moves. Here, the cursor will be sought to a particular location. Syntax:  fileobject.seek(position) 3. flush() The usage of flush  method is clean out the internal buffer. Before writing the text in the file, it is best practice to clear out that the internal buffer can be cleared. Syntax:  ...