<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mainak Das on Medium]]></title>
        <description><![CDATA[Stories by Mainak Das on Medium]]></description>
        <link>https://medium.com/@mainak17?source=rss-410db4f5a0dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1ZEranJkQg_Zt_elSmQhWQ.jpeg</url>
            <title>Stories by Mainak Das on Medium</title>
            <link>https://medium.com/@mainak17?source=rss-410db4f5a0dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:17:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mainak17/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Transforming Postgres Table Data to JSON Using Python & SQL]]></title>
            <link>https://python.plainenglish.io/transforming-postgres-table-data-to-json-using-python-sql-c93bc37c1305?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c93bc37c1305</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Wed, 29 Nov 2023 18:07:28 GMT</pubDate>
            <atom:updated>2023-11-30T01:54:29.405Z</atom:updated>
            <content:encoded><![CDATA[<p>How to convert Multiple Postgres Tables Data into JSON Files Using Python &amp; SQL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bFemGnsn9brymH586hO1TA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@linmoumou?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">archcookie</a> on <a href="https://unsplash.com/photos/a-very-tall-building-with-a-lot-of-windows-sQpsUqvWgbQ?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Managing data across multiple tables in a project is very common, where the tables are often linked by foreign keys to a central table.</p><p>In a recent project of mine, I encountered this scenario and successfully generated JSON files from several tables — let me share my approach of solving it.</p><p>Imagine You have 4 such tables called</p><ul><li><strong>Attendee</strong></li><li><strong>Event</strong></li><li><strong>Ticket_Type</strong></li><li><strong>Event_Attendance_Fact</strong></li></ul><h3>Table Relationships:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*CTpsEwotp3FSORRZgnrOSQ.png" /></figure><h3>DDLs</h3><p>I asked ChatGPT for some sample DDLs and DMLs. So here you go!</p><pre>-- Event Dimension Table<br>CREATE TABLE &quot;JSON&quot;.&quot;Event&quot; (<br>    Event_ID INT PRIMARY KEY,<br>    Event_Name VARCHAR(100),<br>    Event_Date DATE,<br>    Location VARCHAR(100),<br>    Organizer VARCHAR(100)<br>);<br><br>-- Attendee Dimension Table<br>CREATE TABLE &quot;JSON&quot;.&quot;Attendee&quot; (<br>    Attendee_ID INT PRIMARY KEY,<br>    Attendee_Name VARCHAR(100),<br>    Age INT,<br>    Email VARCHAR(100)<br>);<br><br>-- Ticket Type Dimension Table<br>CREATE TABLE &quot;JSON&quot;.&quot;Ticket_Type&quot; (<br>    Ticket_Type_ID INT PRIMARY KEY,<br>    Ticket_Type VARCHAR(50),<br>    Price DECIMAL(10, 2)<br>);<br><br>-- Event Attendance Fact Table<br>CREATE TABLE &quot;JSON&quot;.&quot;Event_Attendance_Fact&quot; (<br>    Attendance_ID INT PRIMARY KEY,<br>    Event_ID INT REFERENCES &quot;JSON&quot;.&quot;Event&quot;(Event_ID),<br>    Attendee_ID INT REFERENCES &quot;JSON&quot;.&quot;Attendee&quot;(Attendee_ID),<br>    Ticket_Type_ID INT REFERENCES &quot;JSON&quot;.&quot;Ticket_Type&quot;(Ticket_Type_ID),<br>    Number_of_Tickets INT,<br>    Total_Price DECIMAL(12, 2)<br>);</pre><h3>DMLs</h3><p>Insert some Data too.</p><pre>-- Inserting data into Event Dimension Table<br>INSERT INTO &quot;JSON&quot;.&quot;Event&quot; (Event_ID, Event_Name, Event_Date, Location, Organizer)<br>VALUES<br>    (1, &#39;Music Festival&#39;, &#39;2023-07-15&#39;, &#39;City Park&#39;, &#39;Music Society&#39;),<br>    (2, &#39;Tech Conference&#39;, &#39;2023-09-20&#39;, &#39;Convention Center&#39;, &#39;Tech Innovations Inc.&#39;),<br>    (3, &#39;Art Exhibition&#39;, &#39;2023-10-05&#39;, &#39;Art Gallery&#39;, &#39;Creative Minds&#39;);<br><br>-- Inserting data into Attendee Dimension Table<br>INSERT INTO &quot;JSON&quot;.&quot;Attendee&quot; (Attendee_ID, Attendee_Name, Age, Email)<br>VALUES<br>    (1, &#39;John Doe&#39;, 30, &#39;john@example.com&#39;),<br>    (2, &#39;Jane Smith&#39;, 25, &#39;jane@example.com&#39;),<br>    (3, &#39;Michael Johnson&#39;, 35, &#39;michael@example.com&#39;);<br><br>-- Inserting data into Ticket Type Dimension Table<br>INSERT INTO &quot;JSON&quot;.&quot;Ticket_Type&quot; (Ticket_Type_ID, Ticket_Type, Price)<br>VALUES<br>    (1, &#39;General Admission&#39;, 50.00),<br>    (2, &#39;VIP Pass&#39;, 100.00);<br><br>-- Inserting data into Event Attendance Fact Table<br>INSERT INTO &quot;JSON&quot;.&quot;Event_Attendance_Fact&quot; (Attendance_ID, Event_ID, Attendee_ID, Ticket_Type_ID, Number_of_Tickets, Total_Price)<br>VALUES<br>    (1, 1, 1, 1, 2, 100.00), -- John Doe bought 2 General Admission tickets for the Music Festival<br>    (2, 1, 2, 2, 1, 100.00), -- Jane Smith bought 1 VIP Pass for the Music Festival<br>    (3, 2, 3, 1, 3, 150.00); -- Michael Johnson bought 3 General Admission tickets for the Tech Conference</pre><p>After Inserting the Data the Tables will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*s1DeN0UVs4biIm6KbyY2Jg.png" /><figcaption><strong>Event </strong>Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*NmSinaA378lFwu17SAXmJw.png" /><figcaption><strong>Attendee </strong>Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*o8sKS14hUAfsdb5yU51tIw.png" /><figcaption><strong>Ticket_Type </strong>Table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*PhzMrWHMHhqFvSlo-a4gqg.png" /><figcaption><strong>Event_Attendance_Fact </strong>Tabel</figcaption></figure><p>Now Let&#39;s assume we want to create a JSON File from the provided sample.</p><h3>JSON Sample</h3><pre>{<br>  &quot;attendanceId&quot; : 1, <br>  &quot;attendeeInfo&quot; : <br>    {  <br>      &quot;attendeeName&quot; : &quot;John Doe&quot;, <br>      &quot;age&quot; : 30, <br>      &quot;email&quot; : &quot;john@example.com&quot;<br>    }, <br>  &quot;eventInfo&quot; : <br>    {<br>      &quot;eventName&quot; : &quot;Music Festival&quot;, <br>      &quot;eventDate&quot; : &quot;2023-07-15&quot;, <br>      &quot;location&quot; : &quot;City Park&quot;, <br>      &quot;organizer&quot; : &quot;Music Society&quot;<br>    }, <br>  &quot;ticketInfo&quot; : <br>    {<br>      &quot;ticketType&quot; : &quot;General Admission&quot;, <br>      &quot;price&quot; : 50.00<br>    }<br>}</pre><p>Now, when faced with such a scenario, it’s vital to establish an approach that remains maintainable, easy to comprehend, and doesn’t ask for hours to decipher when revisited.</p><h3>Breaking Down the Process</h3><blockquote><strong>Let&#39;s look at the smallest sections first</strong></blockquote><p><strong>Here we have</strong> — <em>ticketInfo, eventInfo, attendeeInfo. </em>We begin from the smallest sub-sections in the JSON.</p><p>In this example, it&#39;s pretty simple as we are driving these three sections from one single table each.</p><blockquote><strong>Consolidating the Logic</strong></blockquote><p>The next step involves implementing these segments into a single, coherent code structure.</p><pre>SELECT event_id, to_json(json_build_object(<br>&#39;eventName&#39;,event_name, <br>&#39;eventDate&#39;,event_date, <br>&#39;location&#39;,location, <br>&#39;organizer&#39;,organizer<br>)) AS DATA <br>FROM &quot;JSON&quot;.&quot;Event&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*b8FkZcz3FkNAy9ffhsKL8g.png" /><figcaption>Event Json Structure</figcaption></figure><pre>SELECT ticket_type_id, to_json(json_build_object(<br>&#39;ticketType&#39;,ticket_type,<br>&#39;price&#39;,price<br>)) AS DATA<br>FROM &quot;JSON&quot;.&quot;Ticket_Type&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*DjmYEJPfOMVhzrQnNBbvFA.png" /><figcaption>Ticket JSON Structure</figcaption></figure><pre>SELECT attendee_id, to_json(json_build_object(<br>&#39;attendeeName&#39;,attendee_name, <br>&#39;age&#39;,age, <br>&#39;email&#39;,email<br>)) AS DATA <br>FROM &quot;JSON&quot;.&quot;Attendee&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*ywtn_YLk-CUz9LR2OuI5ow.png" /><figcaption>Attendee JSON Structure</figcaption></figure><blockquote><strong>Now we will be consolidating the whole thing into one single code.</strong></blockquote><pre>WITH Attendee AS (<br>SELECT attendee_id, to_json(json_build_object(<br>&#39;attendeeName&#39;,attendee_name, <br>&#39;age&#39;,age, <br>&#39;email&#39;,email<br>)) AS DATA <br>FROM &quot;JSON&quot;.&quot;Attendee&quot;),<br><br>Event AS (<br>SELECT event_id, to_json(json_build_object(<br>&#39;eventName&#39;,event_name, <br>&#39;eventDate&#39;,event_date, <br>&#39;location&#39;,location, <br>&#39;organizer&#39;,organizer<br>)) AS DATA <br>FROM &quot;JSON&quot;.&quot;Event&quot;),<br><br>Ticket_Type AS (<br>SELECT ticket_type_id, to_json(json_build_object(<br>&#39;ticketType&#39;,ticket_type,<br>&#39;price&#39;,price<br>)) AS DATA<br>FROM &quot;JSON&quot;.&quot;Ticket_Type&quot;),<br><br>Event_Attendance_Fact AS (<br>SELECT attendance_id, event_id, attendee_id, ticket_type_id, number_of_tickets, total_price FROM &quot;JSON&quot;.&quot;Event_Attendance_Fact&quot;),<br><br>JSON_OUTPUT AS ( SELECT attendance_id, to_json(json_build_object(<br>&#39;attendanceId&#39;,Event_Attendance_Fact.attendance_id,<br>&#39;attendeeInfo&#39;,Attendee.DATA,<br>&#39;eventInfo&#39;,Event.DATA,<br>&#39;ticketInfo&#39;,Ticket_Type.DATA<br>)) AS DATA<br>FROM Event_Attendance_Fact<br>INNER JOIN Attendee<br>ON Event_Attendance_Fact.attendee_id = Attendee.attendee_id<br>INNER JOIN Event<br>ON Event_Attendance_Fact.event_id = Event.event_id<br>INNER JOIN Ticket_Type<br>ON Event_Attendance_Fact.ticket_type_id = Ticket_Type.ticket_type_id<br>)<br><br>SELECT * FROM JSON_OUTPUT;</pre><p>Here is the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ic4o4LdRo_I8w4bJ44WlRQ.png" /></figure><blockquote><strong>Execution Using Python</strong></blockquote><p>Use Python (utilizing psycopg2 library) to execute this query and convert the outcome into a DataFrame or We can just iterate through the result we receive.</p><blockquote><strong>Iterative JSON Generation</strong></blockquote><p>Through iterative processing of the result, we can seamlessly generate a JSON file or send the JSON data to a downstream API.</p><blockquote><strong>Here is the code ChatGPT provided</strong></blockquote><pre>import psycopg2<br>import json<br><br># Establish a connection to your database<br>conn = psycopg2.connect(<br>    dbname=&quot;your_dbname&quot;,<br>    user=&quot;your_username&quot;,<br>    password=&quot;your_password&quot;,<br>    host=&quot;your_host&quot;,<br>    port=&quot;your_port&quot;<br>)<br><br># Create a cursor object<br>cur = conn.cursor()<br><br># Read SQL query from a file<br>with open(&#39;your_query_file.sql&#39;, &#39;r&#39;) as sql_file:<br>    sql_query = sql_file.read()<br><br># Execute the query<br>cur.execute(sql_query)<br><br># Fetch all results<br>results = cur.fetchall()<br><br># Close cursor and connection<br>cur.close()<br>conn.close()<br><br># Generate separate JSON files for each attendance_id<br>for result in results:<br>    attendance_id = result[0]  # Assuming attendance_id is the first column<br>    data = result[1]  # Assuming JSON data is the second column<br><br>    filename = f&quot;{attendance_id}.json&quot;<br>    with open(filename, &#39;w&#39;) as file:<br>        json.dump(data, file, indent=4)</pre><h3>More Information</h3><p>This was a very simple example where we had a very small number of tables and fewer numbers of logic to implement. There are more functions like — jsonb_build_object, json_object_agg, json_agg etc which are very useful for this kind of task.</p><p>Although I have been working on this for quite some time now, I don&#39;t know every ins and outs of it.</p><p>For example, in my code, if you remove the to_json() part, it will still work and give you the result but I have decided to keep it.</p><p>Another example would be — instead of using to_json() if we use json_agg() we can create an array of JSON like objects with a key and value pair.</p><blockquote><strong>Pro Tip : Using this function </strong>json_build_object() <strong>is good, but it has a limit of 100 arguments.</strong></blockquote><p>So you can only enter 50 keys along with 50 values within this.</p><blockquote><strong>How to resolve the issue</strong></blockquote><pre>jsonb_build_object(&#39;key1&#39;,&#39;value1&#39;,...,&#39;key50&#39;,&#39;value50&#39;) || jsonb_build_object(&#39;key51&#39;,&#39;value51&#39;,...,&#39;key100&#39;,&#39;value100&#39;)</pre><p>Solution thanks to good old <a href="https://stackoverflow.com/questions/53376451/cannot-pass-more-than-100-arguments-to-a-function-to-json-build-object">Stackoverflow</a></p><blockquote><strong>Conclusion</strong></blockquote><p>Creating JSON files this way has the best advantage of <strong>Scalability </strong>and <strong>Modularity </strong>of the Code. If the source data changes or something similar happens when new tables have to be added — just changing the .sql file code can help you maintain the code.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><h3><a href="https://plainenglish.io/">PlainEnglish.io</a> 🚀</h3><p><em>Thank you for being a part of the In Plain English community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer</em><strong>️</strong></li><li><em>Learn how you can also </em><a href="https://plainenglish.io/blog/how-to-write-for-in-plain-english"><strong><em>write for In Plain English</em></strong></a><em>️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>X</em></strong></a><strong><em> | </em></strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em> | </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em> | </em></strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em> | </em></strong><a href="https://newsletter.plainenglish.io/"><strong><em>Newsletter</em></strong></a></li><li><em>Visit our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a><strong><em> | </em></strong><a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a><strong><em> | </em></strong><a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c93bc37c1305" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/transforming-postgres-table-data-to-json-using-python-sql-c93bc37c1305">Transforming Postgres Table Data to JSON Using Python &amp; SQL</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Pros and Cons of Data Warehouse and Data Lakes]]></title>
            <link>https://python.plainenglish.io/understanding-the-pros-and-cons-of-data-warehouse-and-data-lakes-d0c79f784d21?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0c79f784d21</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-warehouse]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 17:52:42 GMT</pubDate>
            <atom:updated>2023-03-03T13:02:02.961Z</atom:updated>
            <content:encoded><![CDATA[<p>Choose The Right Data Solution For Your Business By Understanding The Pros &amp; Cons Of Data Warehouse and Data Lakes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxBRUnHoGIwt6jAHc4-lqw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@tvick?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Taylor Vick</a> on <a href="https://unsplash.com/photos/M5tzZtFCOfs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In today’s world, data is being generated at an unprecedented rate. Every day organizations have to collect and process data from a variety of sources such as sensors, websites, social media, customer feedback, and more, but just collecting data is not enough. It has to be stored, processed, and analyzed in a meaningful way to derive insights and make informed business decisions. This is where data warehousing and data lakes come in.</p><p>Data warehouses and data lakes are two common methods used to store and analyze large amounts of data. While both have the same ultimate goal of storing and managing data, there are significant differences in how they approach this task. In this guide, we’ll explore the differences between data warehousing and data lakes, as well as their advantages and disadvantages.</p><h3>Data Warehouse</h3><p>A data warehouse is a method of storing data that has been in use for several decades. The idea behind data warehousing is to store data from various sources in a <strong><em>central location</em></strong>, usually in a <strong><em>structured, relational database</em></strong>. The data is extracted from operational systems and transformed to meet the specific needs of the data warehouse. Once in the data warehouse, the data can be <strong>analyzed</strong>, and <strong>reports </strong>can be generated.</p><h3>The architecture of a Data Warehouse</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQSb6kXZOoXHpzZOVs8SaA.png" /><figcaption><a href="https://www.scaler.com/topics/architecture-of-data-warehouse/">Source</a></figcaption></figure><h3>Advantages of Data Warehousing</h3><ol><li><strong>Reliability</strong>: A data warehouse provides reliable and consistent data that can be trusted. The data is typically cleaned, transformed, and loaded into the data warehouse, which means it has undergone a rigorous process to ensure data quality.</li><li><strong>Security</strong>: A data warehouse provides enhanced security features to protect data against unauthorized access. Access to the data warehouse is typically restricted to authorized personnel only.</li><li><strong>Query Performance</strong>: Data warehouse provides optimized query performance due to the use of indexes, partitioning, and other techniques. Query results are returned quickly, even when dealing with large amounts of data.</li><li><strong>Analytics</strong>: Data warehousing provides a single, centralized location for data analysis. Data can be sliced and diced in many different ways to gain insights that can help drive business decisions.</li></ol><h3>Disadvantages of Data Warehousing</h3><ol><li><strong>Scalability</strong>: A data warehouse can be expensive to scale. Adding more data can require additional hardware and software costs.</li><li><strong>Complexity</strong>: Building and maintaining a data warehouse can be complex and time-consuming. It requires a significant amount of design, development, and testing.</li><li><strong>Limited Flexibility</strong>: Once data is stored in a data warehouse, it can be challenging to make changes to the structure. Making changes can require significant effort and time.</li></ol><h3>Data Lakes</h3><p>Data lakes are a relatively new approach to storing and managing large amounts of data. The concept behind data lakes is to store all types of data, <strong><em>structured </em></strong>and <strong><em>unstructured</em></strong>, in a <strong><em>single location</em></strong>. The data is <strong><em>not transformed</em></strong> or structured in any way when it is loaded into the data lake. Instead, the data is <strong><em>left in its raw form </em></strong>until it is needed for analysis.</p><h3>The architecture of a Data Lake</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VkDtbUJTUixYEr3o.png" /><figcaption><a href="https://www.interviewbit.com/blog/data-lake-architecture/">Source</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*PJ4omNoQaWd0bZe9" /><figcaption><a href="https://dwbi1.wordpress.com/2022/01/20/data-lake-architecture/">Source</a></figcaption></figure><h3>Advantages of Data Lakes</h3><ol><li><strong>Cost-Effective</strong>: Data lakes are typically more cost-effective than data warehouses. They can be built using commodity hardware and open-source software.</li><li><strong>Flexibility</strong>: Data lakes are highly flexible and can store any type of data. This includes structured, semi-structured, and unstructured data. Data can be added and removed from the data lake without having to worry about data structure changes.</li><li><strong>Scalability</strong>: Data lakes are highly scalable and can handle large volumes of data. New hardware can be added to the data lake as needed to accommodate more data.</li><li><strong>Agility</strong>: Data lakes are designed to be agile and support rapid data exploration. Data can be queried and analyzed quickly without having to wait for data to be transformed.</li><li><strong>Real-time Data Processing</strong>: Data lakes can process data in real time, which allows organizations to make decisions quickly based on the most up-to-date information.</li><li><strong>Advanced Analytics</strong>: Data lakes allow for the use of advanced analytics tools and techniques such as machine learning and AI, providing deeper insights and predictive capabilities.</li><li><strong>Data Governance</strong>: Data lakes allow for greater control and governance of data, which is essential for regulatory compliance and data privacy.</li><li><strong>Centralized Data Management</strong>: Data lakes provide a centralized location for all of an organization’s data, making it easier to access, manage, and analyze.</li><li><strong>Data Democratization</strong>: Data lakes allow for more people within an organization to access and analyze data, which can lead to more informed decision-making at all levels of the organization.</li></ol><h3>Disadvantages of Data Lakes</h3><ol><li><strong>Data Quality</strong>: One of the biggest risks of data lakes is the possibility of poor data quality. Since data lakes are designed to store large amounts of raw, unstructured data, it’s easy for data quality issues to go undetected, which can result in inaccurate analysis and decision-making.</li><li><strong>Security</strong>: Data lakes can present security challenges, particularly if they contain sensitive or regulated data. Since data lakes are designed for accessibility and flexibility, they may not have the same level of security controls as a traditional data warehouse, which can increase the risk of data breaches.</li><li><strong>Governance</strong>: Without proper governance, data lakes can quickly become unmanageable. Since data lakes are often designed to accommodate a wide range of data sources, it can be difficult to establish consistent data definitions and ensure data consistency, which can impede data analysis and decision-making.</li><li><strong>Cost</strong>: Data lakes can be expensive to implement and maintain, particularly if they involve large volumes of data. The costs of storage, processing, and analysis can add up quickly, which can be a challenge for organizations with limited resources.</li><li><strong>Complexity</strong>: Finally, data lakes can be complex to manage, particularly if they involve a wide range of data sources and formats. Ensuring that data is properly integrated and consistent across the lake can require significant effort and expertise, which can be a challenge for organizations that lack the necessary skills and resources.</li></ol><h3>Conclusion</h3><p>Data warehouses and data lakes are two different solutions to the challenges of managing large amounts of data. Each has its own unique advantages and disadvantages, and the choice between the two depends on the specific needs of your business.</p><p>Data warehouses are best suited for <strong>structured </strong>data and provide a <strong><em>reliable</em></strong>, <strong><em>scalable</em></strong>, and <strong>secure </strong>environment for storing and analyzing data.</p><p>On the other hand, data lakes are designed for <strong>unstructured and semi-structured</strong> data, offering more <strong><em>flexibility </em></strong>and <strong><em>agility </em></strong>in dealing with new and diverse data sources.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0c79f784d21" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/understanding-the-pros-and-cons-of-data-warehouse-and-data-lakes-d0c79f784d21">Understanding the Pros and Cons of Data Warehouse and Data Lakes</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Engineering 101: Understanding the Differences Between OLAP and OLTP]]></title>
            <link>https://medium.com/@mainak17/data-engineering-101-understanding-the-differences-between-olap-and-oltp-ab41d3a4baa3?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab41d3a4baa3</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-engineering-101]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Sat, 25 Feb 2023 19:57:06 GMT</pubDate>
            <atom:updated>2023-02-25T19:57:06.956Z</atom:updated>
            <content:encoded><![CDATA[<p>A Comprehensive Guide to OLAP and OLTP Systems</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qfmk0CfVAGi4j0nYcymEIQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@fattycorgi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">fatty corgi</a> on <a href="https://unsplash.com/images/animals/dog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>When it comes to database architecture, two popular terms often come up in conversations — <strong>OLAP </strong>and <strong>OLTP</strong>. While they may sound similar, they represent two distinct approaches to organizing data. This article will provide an overview of OLAP and OLTP, their differences, and their applications.</p><h3><strong>What is OLAP?</strong></h3><p><strong>OLAP </strong>stands for <strong>Online Analytical Processing</strong>. It is a database architecture designed for data warehousing and business intelligence.</p><p>OLAP databases are optimized for complex queries and data analysis, with a focus on <strong>providing fast query response times</strong> for ad hoc analysis.</p><p>OLAP databases are typically structured in a <strong>multidimensional schema</strong>, with data organized into dimensions and measures. OLAP databases use a <strong>star </strong>or <strong>snowflake </strong>schema, which allows for efficient querying and aggregation of data.</p><h3><strong>Advantages of OLAP:</strong></h3><ul><li>Fast query response times</li><li>Efficient data analysis</li><li>Multidimensional schema for organizing complex data</li><li>Supports complex calculations and aggregations</li></ul><h3><strong>Disadvantages of OLAP:</strong></h3><ul><li>Large data sets can be slow to process</li><li>Requires specialized hardware and software</li><li>Not suitable for transactional processing</li><li>Can be expensive to implement and maintain</li></ul><h3><strong>Applications of OLAP:</strong></h3><ul><li>Business intelligence and analytics</li><li>Financial reporting and analysis</li><li>Sales forecasting and analysis</li><li>Supply chain analysis</li></ul><h3><strong>What is OLTP?</strong></h3><p><strong>OLTP </strong>stands for <strong>Online Transaction Processing</strong>. It is a database architecture designed for <strong>transactional processing</strong>, such as order processing, inventory management, and customer relationship management.</p><p>OLTP databases are optimized for <strong>fast transaction processing</strong>, with a focus on maintaining data accuracy and consistency. OLTP databases use a <strong>normalized schema</strong>, which allows for <strong>efficient updates and inserts of data</strong>.</p><h3><strong>Advantages of OLTP:</strong></h3><ul><li>Fast transaction processing</li><li>Maintains data accuracy and consistency</li><li>Normalized schema for efficient data updates and inserts</li><li>Supports concurrent transactions</li></ul><h3><strong>Disadvantages of OLTP:</strong></h3><ul><li>Not optimized for data analysis and reporting</li><li>Limited support for complex queries and calculations</li><li>Can be slow to process large data sets</li><li>May require additional data processing for reporting and analytics</li></ul><h3>Applications of OLTP:</h3><ul><li>E-commerce and online retail transactions</li><li>Banking and Finance transactions.</li><li>Healthcare management</li><li>Customer relationship management</li></ul><h3><strong>OLAP vs OLTP: Key Differences</strong></h3><p>Here are some key differences between OLAP and OLTP:</p><ol><li><strong>Purpose</strong>: OLAP databases are designed for <strong><em>data analysis and reporting</em></strong>, while OLTP databases are designed for <strong><em>transactional processing.</em></strong></li><li><strong>Schema</strong>: OLAP databases use a <strong><em>multidimensional </em></strong>schema, while OLTP databases use a <strong><em>normalized</em></strong> schema.</li><li><strong>Querying</strong>: OLAP databases are <strong><em>optimized for complex querying</em></strong> and <strong><em>ad hoc analysis</em></strong>, while OLTP databases are <strong><em>optimized for fast transaction processing</em></strong>.</li><li><strong>Data volume</strong>: OLAP databases can handle <strong><em>large data sets</em></strong>, while OLTP databases are better suited for <strong><em>handling smaller data sets</em></strong>.</li><li><strong>Hardware requirements</strong>: OLAP databases often require <strong><em>specialized hardware</em></strong> and software for <strong><em>optimal performance</em></strong>, while OLTP databases can<strong><em> run on standard hardware</em></strong>.</li></ol><h3><strong>Conclusion</strong></h3><p>Choosing the right database architecture for your business needs can be challenging. OLAP and OLTP offer distinct approaches to organizing and processing data, with their own advantages and disadvantages.</p><p>If your business requires <strong><em>complex data analysis</em></strong> and <strong><em>reporting</em></strong>, <strong>OLAP </strong>may be the better choice.</p><p>If you need <strong><em>fast transaction processing</em></strong> and <strong><em>data consistency</em></strong>, <strong>OLTP </strong>may be the way to go.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab41d3a4baa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Slowly Changing Dimensions (SCD) in Data Warehousing]]></title>
            <link>https://python.plainenglish.io/understanding-slowly-changing-dimensions-scd-in-data-warehousing-20a566ae3fdd?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/20a566ae3fdd</guid>
            <category><![CDATA[data-warehouse]]></category>
            <category><![CDATA[data-modeling]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 20:55:38 GMT</pubDate>
            <atom:updated>2023-02-28T06:24:26.556Z</atom:updated>
            <content:encoded><![CDATA[<h4>Exploring Different SCD Types, Their Advantages, Disadvantages, and Applications.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IB2Ts7hY9AelNHHnKw8OJA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@victor_vector?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Victor Grabarczyk</a> on <a href="https://unsplash.com/images/animals/dog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Slowly changing dimensions (SCD) is an important concept in data warehousing that <strong><em>deals with managing the historical data </em></strong>of slowly changing data over time. There are different types of SCDs, each with its own characteristics, advantages, and disadvantages.</p><p>In this article, we will explore the different types of SCDs, their definitions, advantages, disadvantages, and applications. We will also provide sample Python code to help you understand how to implement SCDs in your data warehousing project.</p><h3>What are Slowly Changing Dimensions (SCD)?</h3><p>In data warehousing, slowly changing dimensions are dimensions that change over time, but at a slow pace. These dimensions typically store historical data about an entity, such as a customer, product, or location. Slowly changing dimensions are important for tracking changes in the data over time, and for making accurate reports and analyses.</p><p>There are three main types of slowly changing dimensions: Type 1, Type 2, and Type 3.</p><h3>SCD Type 1</h3><p>SCD Type 1, also known as the <strong><em>overwrite </em></strong>method, updates the dimension table with the latest data without maintaining the history. It simply overwrites the existing data with the new data. This method is suitable for situations where historical data is not required.</p><h3><strong>Advantages of Type 1 SCD:</strong></h3><ul><li>Simple and easy to implement</li><li>Requires less storage space</li><li>Suitable for data that does not require historical information</li></ul><h3><strong>Disadvantages of Type 1 SCD:</strong></h3><ul><li>Historical data is lost</li><li>Does not support reporting and analysis of historical data</li></ul><h3>Applications of SCD Type 1:</h3><ul><li>It can be used in <strong>Customer Address</strong> data where the customer’s old address is replaced with the new address, and the history of the old address is not stored.</li><li>It can be used in <strong>Employee Salary</strong> data, when an employee’s salary is updated, the old salary is replaced with the new salary, and the history of the old salary is not maintained.</li><li>It can be used in <strong>Inventory data when</strong> the stock of an item is updated, the new stock level replaces the old stock level, and the history of the changes is not stored.</li></ul><h3>Example of SCD Type 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*2JfAKO05bgEGonRZshFmhA.png" /><figcaption>Image By Me</figcaption></figure><h3>Explanation of SCD Type 1 :</h3><p>Suppose you have a table with columns ID, Name, and Address. You receive updated data from your source, where is a change in the address of a customer or multiple customers.</p><p>In SCD Type 1, you simply update the existing record with the new address without keeping a history of previous addresses.</p><h3>SCD Type 2</h3><p>Type 2 SCD, also known as the historical tracking method, <strong>maintains the history of changes</strong> in the dimension table by creating a new record for each change. It adds a new record with a <strong>new primary key</strong> every time a change occurs. This method is suitable for situations where historical data is required for reporting and analysis.</p><h3><strong>Advantages of SCD </strong>Type 2<strong>:</strong></h3><ul><li>Supports reporting and analysis of historical data</li><li>No data is lost</li><li>Accurately tracks changes over time</li></ul><h3><strong>Disadvantages of SCD </strong>Type 2<strong>:</strong></h3><ul><li>Requires more storage space</li><li>Can be complex to implement</li></ul><p>Sample Python code:</p><h3>Applications of SCD Type 2:</h3><ul><li>Can be used in <strong>sales </strong>data where you can track your profit or sales of a particular item over time to help you analyse your sales.</li><li>It can be used in <strong>customer </strong>or <strong>order </strong>data where you can keep a track of the previous order of a person and recommend items based on that.</li><li>It can be used in <strong>expense </strong>data where you can track your daily expenses and analyse your daily expense.</li></ul><h3>Example of SCD Type 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*w9-PVdRwczKB8JL5XaN40w.png" /><figcaption>Image By me</figcaption></figure><h3>Explanation</h3><p>Suppose you have the same data as earlier but you want to implement SCD Type 2 in that. here you use two to three different extra columns to track the history of your data.</p><p>Here I have added <strong>Start Date</strong> &amp; <strong>End Date </strong>to our incoming data. Whenever a record is <strong>Active </strong>i.e the incoming record is unchanged and is matching your existing record the <strong>End Date</strong> is <strong><em>Null</em></strong>.</p><p>Initially, the two records were in the active state so the End Date was Null. Later with the new data, we notice that they are different from the existing data and there is a new record as well.</p><p>So we close those active records and update the <strong>End Date</strong> with the <strong>current date</strong> and we add three new entries to our existing table.</p><blockquote><strong>NOTE</strong>: We can also use some columns such as <strong>flag / active </strong>with 0 or 1 values to denote whether it is an active or closed record along with the dates. Also for the <strong>End Date </strong>you can use current_day-1 based on your <strong>design and requirements</strong>, in this case that will be <strong>2022–02-20. </strong>Sometimes this approach makes it easier to handle the overlapping of the same date in Start Date and End Date.</blockquote><blockquote>From my personal experience, I cannot help but <strong>emphasise this again</strong>,</blockquote><blockquote>To fetch <strong>active records</strong>, query : <strong>select …. where end_date is null</strong></blockquote><blockquote>To fetch <strong>closed records</strong>, query : <strong>select …. where end_date is not null</strong></blockquote><h3>SCD Type 3</h3><p>SCD Type 3 stands for Slowly Changing Dimension Type 3. It is a technique used in data warehousing to capture historical data while limiting the amount of storage space required. SCD Type 3 maintains only a limited history of changes, usually only the <strong>current value</strong> and <strong>the previous value </strong>in form of a <strong><em>column versioning</em></strong> rather than <strong><em>row versioning like SCD Type 2</em></strong>.</p><h3>Advantages of SCD Type 3:</h3><ul><li>It requires less storage space compared to SCD Type 2.</li><li>It is useful when we want to track only limited historical changes for specific columns.</li><li>It enables fast queries as there is limited history to scan.</li></ul><h3>Disadvantages of SCD Type 3:</h3><ul><li>It does not provide a complete history of changes as it only tracks limited changes.</li><li>It may not be suitable for tracking changes for columns that may require full history.</li></ul><h3>Applications of SCD Type 3:</h3><ul><li>It is useful in cases where the user needs to know only the current value and previous value of specific columns.</li><li>It is commonly used in <strong>retail </strong>sales or <strong>financial </strong>reporting where the current and previous value of a product or service is important.</li><li>It is also used in cases where there is limited space available for storing historical data.</li></ul><h3>Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*4Og7VVU99vsPEtciD3flNg.png" /><figcaption>Image By Me</figcaption></figure><h3>Explanation</h3><p>Here, taking the same data as before, we have one new record and two updated records in our source data. So after ingesting, we update the <strong><em>Prev_Address </em></strong>field with the values of the <strong><em>old address</em></strong> of the customer. In place of the <strong><em>Address</em></strong>, comes the new address that was ingested. For the new record, as there is no previous entry with the same primary key, it updates as it is leaving the <strong><em>Prev_Address </em></strong>as <strong><em>Null</em></strong></p><h3>Extras</h3><p>There is also <strong>SCD Type 0, </strong>where none of the fields is updated<strong> </strong>ever. A good example of this will be a reference table of some sort.</p><p>There are also <strong>SCD Type 4</strong>, also known as hybrid SCDs, which combine aspects of both SCD Type 1 and SCD Type 2. In this type, the slowly changing dimension is kept in a separate table, which is linked to the main table via a foreign key. This allows for both the original and updated data to be retained, while still maintaining a small footprint for the main table.</p><p>Suppose we have a product table with attributes such as <strong><em>Id, name, description, and price</em></strong>. If we want to maintain the history of changes to the price attribute, we can use <strong>SCD Type 5</strong>. In this case, we create a new table to store the historical data, with columns such as <strong><em>id, price, start date, and end date</em></strong>. Whenever there is a <strong><em>change to the price attribute</em></strong>, we insert a new record into the historical table with the new price and start date and update the current record in the product table with the new price.</p><p>In SCD Type 6, it uses a hybrid approach between type 1,type 2 and type 3 (1+2+3=6). The data includes columns for both <strong>current </strong>and <strong>historical data</strong>, as well as a column that tracks the current version of a record. This allows for both current and historical data to be stored in the same row, with the current version easily accessible. This type of SCD is useful when a business wants to see both current and historical data in the same report.</p><p>In SCD Type 7, it uses a similar approach to type 6, but instead of including a column for the current version of a record, it creates a <strong><em>separate table to store all historical data</em></strong>. The main table only includes columns for the current data. This allows for <strong><em>better performance</em></strong> when querying the current data, while still providing access to historical data through the separate table. This type of SCD is useful when historical data needs to be accessed less frequently than current data.</p><blockquote>The most commonly used SCD types are SCD Type 1, SCD Type 2, and SCD Type 3</blockquote><h3>Conclusion</h3><p>SCDs are important for maintaining the integrity and accuracy of your data over time. Choosing the right SCD type depends on the needs of your data and the application it is being used for. Understanding the differences between the SCD types and their advantages and disadvantages can help you make informed decisions about your data modelling strategy.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20a566ae3fdd" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/understanding-slowly-changing-dimensions-scd-in-data-warehousing-20a566ae3fdd">Understanding Slowly Changing Dimensions (SCD) in Data Warehousing</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Python Topics: Metaclasses vs Inheritance]]></title>
            <link>https://python.plainenglish.io/advanced-python-topics-metaclasses-vs-inheritance-a39154ebb6f2?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a39154ebb6f2</guid>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[inheritance]]></category>
            <category><![CDATA[python-interview-question]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 19:06:00 GMT</pubDate>
            <atom:updated>2023-02-24T01:33:43.612Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the differences between Metaclasses and Inheritance in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*caTlEJc6bbFvbbs6MPvShg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Hitesh Choudhary</a> on <a href="https://unsplash.com/photos/D9Zow2REm8U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>When it comes to creating complex and sophisticated software applications, Python provides a wide range of features and concepts to help developers achieve their goals. Two of the most important and powerful tools that Python offers are meta classes and inheritance. Both of these concepts play a key role in the object-oriented programming paradigm and allow developers to create new classes, extend existing classes, and add custom behaviour to their applications.</p><h3><strong>Inheritance</strong></h3><p><strong><em>Inheritance </em></strong>is a fundamental concept in object-oriented programming. It allows you to create a new class that is a modified version of an existing class. The new class is called the subclass or derived class and the existing class is called the superclass or base class. The subclass inherits all the attributes and methods of the superclass, and can also add its own unique attributes and methods. This is a great way to reuse code, reduce duplicated code, and make it easier to maintain the code.</p><pre>class Animal:<br>    def __init__(self, name):<br>        self.name = name<br><br>    def speak(self):<br>        raise NotImplementedError(&quot;Subclass must implement abstract method&quot;)<br><br>class Dog(Animal):<br>    def speak(self):<br>        return &quot;Woof&quot;<br><br>class Cat(Animal):<br>    def speak(self):<br>        return &quot;Meow&quot;</pre><p>In this example, Animal is the base class, and Dog and Cat are subclasses. The Dog and Cat classes inherit the __init__ method from the Animal class, which means they can create instances of Dog and Cat with a name attribute. They also override the speak method to provide their own implementation. When you call the speak method on a Dog instance, it returns &quot;Woof&quot;, and when you call it on a Cat instance, it returns &quot;Meow&quot;.</p><h3><strong>Metaclasses</strong></h3><p><strong><em>Metaclasses</em></strong>, on the other hand, are classes that define the behaviour of other classes. They control how objects of the class are created and can be used to change the way that classes behave. For example, you can use a metaclass to add new methods to a class, change the way that methods behave, or even prevent objects from being created from a class.</p><pre>class MyMetaClass(type):<br>    def __new__(cls, name, bases, attrs):<br>        print(f&quot;Creating class {name}&quot;)<br>        new_cls = super().__new__(cls, name, bases, attrs)<br>        new_cls.custom_attribute = &quot;This is a custom attribute&quot;<br>        return new_cls<br><br>class MyClass(metaclass=MyMetaClass):<br>    pass<br><br>print(MyClass.custom_attribute)  # Output: &quot;This is a custom attribute&quot;</pre><p>In this example, we define a custom metaclass MyMetaClass which will be used to create the class MyClass. When the MyClass class is created, the __new__ method of the MyMetaClass metaclass is called. This method takes in four arguments:</p><ul><li>cls: The metaclass itself (i.e. MyMetaClass)</li><li>name: The name of the class being created (i.e. &quot;MyClass&quot;)</li><li>bases: A tuple of the base classes of the class being created (i.e. (object,))</li><li>attrs: A dictionary of the class attributes (i.e. {})</li></ul><p>In the __new__ method, we print out a message indicating that a new class is being created, and then we call the __new__ method of the superclass (type) to actually create the class. We also add a custom attribute to the class (custom_attribute) before returning it.</p><p>When we create an instance of MyClass and access the custom_attribute attribute, we can see that it has been added by our metaclass.</p><h3>The Difference</h3><p>The main difference between inheritance and meta classes is that inheritance allows you to <strong><em>inherit attributes and methods</em></strong> from an existing class, while meta classes allow you to <strong><em>change the behaviour</em></strong> of a class.</p><h3><strong>When to Use Inheritance</strong></h3><p>Inheritance is best used when you want to create <strong><em>a new class that is a modified version of an existing class</em></strong>. It’s a great way to reuse code and reduce duplicated code, and it makes it easier to maintain the code.</p><h3><strong>When to Use Metaclasses</strong></h3><p>Metaclasses are best used when you <strong><em>want to change the behaviour of a class, or to define custom behaviour for a class</em></strong>. They allow you to <strong><em>change the way that objects are created and how classes behave</em></strong>, which makes them a powerful tool for advanced programming.</p><h3><strong>Conclusion</strong></h3><p>Inheritance and metaclasses are both important and powerful tools in Python that allow developers to create new classes, extend existing classes, and add custom behaviour to their applications.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a39154ebb6f2" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/advanced-python-topics-metaclasses-vs-inheritance-a39154ebb6f2">Advanced Python Topics: Metaclasses vs Inheritance</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to File Formats in Data Engineering]]></title>
            <link>https://python.plainenglish.io/a-comprehensive-guide-to-file-formats-in-data-engineering-623c68521958?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/623c68521958</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Mon, 20 Feb 2023 15:58:10 GMT</pubDate>
            <atom:updated>2023-02-23T07:21:45.787Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the Pros and Cons of using CSV, JSON, Parquet, Avro, and ORC file format in Data Engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71TTPkOJaZrLAD9z4EEoDw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mbaumi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Mika Baumeister</a> on <a href="https://unsplash.com/photos/Wpnoqo2plFA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>In big data and data engineering, choosing the right file format is crucial for the efficient storage and processing of large data sets. There are many file formats that are available in the market, each with its strengths and weaknesses. In this article, we will explore some of the most popular file formats used in big data/data engineering.</p><h3>1. CSV</h3><p><strong>Overview:</strong> CSV (Comma Separated Values) is a simple file format used for storing tabular data, where each line of the file represents a single row and each value in a row is separated by a comma.</p><p><strong>Advantages:</strong></p><ul><li>Easy to read and write</li><li>Can be easily imported into a wide range of data analysis tools</li><li>Small file size</li></ul><p><strong>Disadvantages:</strong></p><ul><li>Not efficient for storing large data sets with complex data types</li><li>Can lead to data loss if values contain commas or line breaks</li><li>Limited support for encoding</li></ul><p><strong>Application</strong>: CSV is commonly used for small data sets and as a standard format for data exchange between different applications.</p><p><strong>Example</strong></p><pre>name,age,gender<br>John,25,M<br>Jane,32,F<br>Bob,45,M</pre><h3>2. JSON</h3><p><strong>Overview</strong>: JSON (JavaScript Object Notation) is a lightweight file format used for storing and exchanging data, which is based on the JavaScript programming language. It is a text-based format that uses a key-value structure to represent data.</p><p><strong>Advantages</strong>:</p><ul><li>Human-readable and easy to understand</li><li>Can be easily parsed and manipulated with different programming languages</li><li>Supports complex data types, such as arrays and nested objects</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Can be less efficient for storing and processing large data sets compared to other binary formats</li><li>Limited support for data compression</li></ul><p><strong>Application</strong>: JSON is commonly used for web APIs, NoSQL databases, and as a data exchange format between different applications.</p><p><strong>Example</strong>:</p><pre>{<br>   &quot;name&quot;: &quot;John&quot;,<br>   &quot;age&quot;: 25,<br>   &quot;gender&quot;: &quot;M&quot;<br>},<br>{<br>   &quot;name&quot;: &quot;Jane&quot;,<br>   &quot;age&quot;: 32,<br>   &quot;gender&quot;: &quot;F&quot;<br>},<br>{<br>   &quot;name&quot;: &quot;Bob&quot;,<br>   &quot;age&quot;: 45,<br>   &quot;gender&quot;: &quot;M&quot;<br>}</pre><h3>3. Parquet</h3><p><strong>Overview</strong>: Parquet is a <strong><em>columnar </em></strong>storage format that is optimized for big data workloads. It was developed by Cloudera and Twitter in 2013 as an open-source project. Parquet is built on a compressed columnar data representation, which makes it highly efficient for analytical queries that involve large amounts of data. Parquet is often used in Hadoop-based big data processing systems like Hive, Impala, and Spark.</p><p><strong>Advantages:</strong></p><ul><li><strong>Efficient compression:</strong> Parquet is highly efficient when it comes to compression. It uses various compression algorithms like Snappy, LZO, and Gzip to compress data, which reduces storage requirements and improves query performance.</li><li><strong>Columnar storage:</strong> Parquet stores data in columns rather than rows, which makes it more efficient for analytical queries that typically involve reading only a subset of columns from a large dataset.</li><li><strong>Schema evolution: </strong>Parquet supports schema evolution, which means that you can add, remove, or modify columns without breaking compatibility with existing data. This makes it easy to update data models over time.</li><li><strong>Cross-platform support: </strong>Parquet is an open-source project and is supported by a variety of big data processing systems, including Hadoop, Spark, and Impala.</li></ul><p><strong>Disadvantages:</strong></p><ul><li><strong>Write performance: </strong>Parquet’s columnar storage format can be slower than row-based formats for writes, especially when adding data to existing columns.</li><li><strong>Not suitable for small datasets:</strong> Parquet is optimized for large-scale analytical queries and is not suitable for small datasets or OLTP workloads.</li><li><strong>Query planning overhead:</strong> Columnar storage requires more query planning overhead than row-based storage formats. This can increase query planning time and make it more complex.</li></ul><p><strong>Applications: </strong>Parquet is a popular format for big data processing and is used in a variety of analytical and data science applications. Some specific use cases include:</p><ul><li>Storing and processing large-scale datasets in Hadoop-based systems like Hive and Impala.</li><li>Analyzing data with Spark and other big data processing systems.</li><li>Data warehousing and business intelligence applications that involve analyzing large datasets.</li></ul><p><strong>Example</strong>:</p><pre>+------+---+---+<br>| name |age|gender|<br>+------+---+---+<br>| John | 25|M |<br>| Jane | 32|F |<br>| Bob | 45|M |<br>+------+---+---+</pre><h3>4. Avro</h3><p><strong>Overview:</strong> Avro is a data serialization system that was developed by Apache Software Foundation in 2009. It is a row-based format that is designed to be fast, compact, and extensible. Avro is often used in Hadoop-based big data processing systems like Hive and HBase, as well as in other distributed systems like Kafka and Cassandra.</p><p><strong>Advantages:</strong></p><ul><li><strong>Compact format:</strong> Avro is a compact format that uses binary encoding to reduce storage requirements and improve performance. This makes it ideal for use cases where storage and performance are critical.</li><li><strong>Schema evolution:</strong> Avro supports schema evolution, which means that you can add, remove, or modify fields without breaking compatibility with existing data. This makes it easy to update data models over time.</li><li><strong>Dynamic typing:</strong> Avro supports dynamic typing, which means that you can change the data type of a field at runtime. This makes it easier to handle changes to data models and to work with data from multiple sources.</li><li><strong>Language-agnostic:</strong> Avro is designed to be language-agnostic, which means that it can be used with a variety of programming languages.</li></ul><p><strong>Disadvantages:</strong></p><ul><li><strong>Lack of built-in compression:</strong> Unlike some other big data file formats, Avro does not include built-in compression. This means that you’ll need to use external compression libraries to compress data.</li><li><strong>Slower performance than columnar storage:</strong> Avro’s row-based storage format can be slower than columnar storage formats like Parquet for analytical queries that involve reading only a subset of columns.</li><li>No support for indexing:</li></ul><p><strong>Applications:</strong></p><ol><li><strong>Distributed computing:</strong> Avro is often used in distributed computing environments such as Apache Hadoop, where it is used to serialize data for use in MapReduce jobs.</li><li><strong>Data storage:</strong> Avro is often used as a data storage format for log files, message queues, and other data sources.</li><li><strong>High-throughput systems:</strong> Avro’s compactness and support for compression make it ideal for use in high-throughput systems such as web applications and real-time data processing pipelines.</li></ol><p><strong>Example of Avro data and schema:</strong></p><p><strong>Avro Data</strong></p><pre>{<br>  &quot;name&quot;: &quot;John&quot;,<br>  &quot;age&quot;: 30,<br>  &quot;email&quot;: &quot;john@example.com&quot;<br>}</pre><p><strong>Avro Schema</strong></p><pre>{<br>  &quot;type&quot;: &quot;record&quot;,<br>  &quot;name&quot;: &quot;Person&quot;,<br>  &quot;namespace&quot;: &quot;example.avro&quot;,<br>  &quot;fields&quot;: [<br>    {&quot;name&quot;: &quot;name&quot;, &quot;type&quot;: &quot;string&quot;},<br>    {&quot;name&quot;: &quot;age&quot;, &quot;type&quot;: &quot;int&quot;},<br>    {&quot;name&quot;: &quot;email&quot;, &quot;type&quot;: &quot;string&quot;}<br>  ]<br>}</pre><h3>5. ORC</h3><p><strong>Overview: </strong>ORC (Optimized Row Columnar) is an open-source, <strong><em>columnar </em></strong>storage format for Hadoop-based data processing systems, such as Hive and Pig. It is designed to provide better performance for large-scale data processing, especially for queries that involve reading or filtering large subsets of columns in a dataset.</p><p><strong>Advantages</strong>:</p><ul><li><strong>Improved query performance</strong>: ORC’s columnar storage format makes it easier to read and process data more efficiently, especially for queries that involve reading only a subset of columns. This can lead to significant improvements in query performance and reduced storage costs.</li><li><strong>Reduced I/O and network overhead</strong>: ORC uses lightweight compression techniques to reduce storage and I/O requirements, resulting in faster query execution times.</li><li><strong>Support for complex data types:</strong> ORC supports complex data types, including maps, lists, and structs, which makes it more flexible and useful for working with complex datasets.</li><li><strong>Easy to use: </strong>ORC is designed to be easy to use and integrate with existing Hadoop-based data processing systems, such as Hive and Pig.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li><strong>Limited compatibility</strong>: ORC is primarily designed for use with Hadoop-based data processing systems, which limits its compatibility with other systems.</li><li><strong>Limited adoption</strong>: ORC is not as widely adopted as some other storage formats, such as Parquet and Avro.</li></ul><p><strong>Applications</strong>:</p><ul><li><strong>Big data processing</strong>: ORC is well-suited for processing large datasets in big data environments. Its efficient storage and retrieval mechanisms make it ideal for processing large datasets and running complex queries on those datasets.</li><li><strong>Analytics and reporting</strong>: ORC is commonly used for storing and processing data for analytics and reporting purposes, as it can help to provide faster query performance and reduced storage costs.</li><li><strong>Data warehousing</strong>: ORC can be used for storing and querying data in a data warehouse environment, where it can provide improved query performance and reduced storage costs.</li></ul><p><strong>Example</strong></p><p>Note that ORC files are binary files, so the data appears as binary data in the file. The below example shows only the structure of the file, not the actual binary data.</p><pre>&lt;ORC&gt;<br>  &lt;Metadata/&gt;<br>  &lt;Stripes&gt;<br>    &lt;Stripe&gt;<br>      &lt;Column&gt;<br>        &lt;Data&gt;<br>          &lt;Binary&gt;<br>            &lt;!-- binary data for first row of the first column --&gt;<br>          &lt;/Binary&gt;<br>          &lt;Binary&gt;<br>            &lt;!-- binary data for second row of the first column --&gt;<br>          &lt;/Binary&gt;<br>          &lt;!-- ... more data ... --&gt;<br>        &lt;/Data&gt;<br>      &lt;/Column&gt;<br>      &lt;!-- ... more columns ... --&gt;<br>    &lt;/Stripe&gt;<br>    &lt;!-- ... more stripes ... --&gt;<br>  &lt;/Stripes&gt;<br>&lt;/ORC&gt;</pre><h3>Conclusion</h3><p>In this comprehensive guide, we have explored some of the most common file formats used in big data and data engineering, including CSV, JSON, Avro, Parquet, and ORC. We have examined the advantages and disadvantages of each format, as well as their common applications. By understanding the strengths and weaknesses of each format, data engineers can make informed decisions about which format is best suited for their specific use case.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=623c68521958" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/a-comprehensive-guide-to-file-formats-in-data-engineering-623c68521958">A Comprehensive Guide to File Formats in Data Engineering</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Buzzwords Series: Statistics: Part 1]]></title>
            <link>https://python.plainenglish.io/data-science-buzzwords-series-statistics-part-1-1cbcca6165df?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cbcca6165df</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 16:50:07 GMT</pubDate>
            <atom:updated>2023-02-19T00:42:55.458Z</atom:updated>
            <content:encoded><![CDATA[<p>These are summaries of some buzzwords I often come across while studying Data Science in general.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*geEUTANhEQ14I8euv60rSA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Winkler</a> on <a href="https://unsplash.com/photos/IrRbSND5EUc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Statistics </strong>is a fundamental aspect of data science that deals with the collection, analysis, and interpretation of data. In this article, we will cover some of the most important statistical concepts and how they are used in data science.</p><ol><li><strong>Mean</strong></li></ol><p>The mean, also known as the average, is calculated by adding up all the values in a dataset and dividing by the number of values. It is represented by the symbol μ (mu). The mean gives a general idea of the central tendency of a dataset. In Python, you can calculate the mean using the <strong>mean()</strong> method of the Pandas library.</p><p><strong>Example</strong>:</p><pre>import pandas as pd<br>import numpy as np<br><br>data = [1, 2, 3, 4, 5]<br>mean = np.mean(data)<br>print(mean)</pre><p><strong>Output</strong>: <strong>3.0</strong></p><p>2. <strong>Median</strong></p><p>The median is the middle value in a dataset when the values are sorted in ascending or descending order. It is a good measure of the central tendency for datasets that have outliers or skewness. In Python, you can calculate the median using the <strong>median()</strong> method of the Pandas library.</p><p><strong>Example</strong>:</p><pre>import pandas as pd<br>import numpy as np<br><br>data = [1, 2, 3, 4, 5]<br>median = np.median(data)<br>print(median)</pre><p><strong>Output</strong>: <strong>3.0</strong></p><p>3. <strong>Mode</strong></p><p>The mode is the value that appears most frequently in a dataset. A dataset can have multiple modes or no mode at all. In Python, you can calculate the mode using the <strong>mode()</strong> method of the Pandas library.</p><p><strong>Example</strong>:</p><pre>import pandas as pd<br>from statistics import mode<br><br>data = [1, 2, 3, 4, 5, 5]<br>mode = mode(data)<br>print(mode)</pre><p>Output: <strong>5</strong></p><p>4. <strong>Variance</strong></p><p>Variance is a measure of how much a dataset deviates from its mean. It is calculated by finding the average of the squared differences between each value and the mean. The variance is represented by the symbol σ² (sigma squared). In Python, you can calculate the variance using the <strong>var()</strong> method of the Numpy library.</p><p><strong>Example</strong>:</p><pre>import numpy as np<br><br>data = [1, 2, 3, 4, 5]<br>variance = np.var(data)<br>print(variance)</pre><p>Output: <strong>2.5</strong></p><p>5. <strong>Standard Deviation</strong></p><p>Standard deviation is the square root of the variance and gives a measure of the spread of a dataset. It is represented by the symbol σ (sigma). In Python, you can calculate the standard deviation using the <strong>std()</strong> method of the Numpy library.</p><p>Example:</p><pre>import numpy as np<br><br>data = [1, 2, 3, 4, 5]<br>std_dev = np.std(data)<br>print(std_dev)</pre><p><strong>Output</strong>: 1.4142135623730951</p><p>6. <strong>Correlation</strong></p><p>Correlation is a statistical relationship between two variables. It measures the strength and direction of the relationship and ranges from -1 to 1. A value of -1 indicates a strong negative relationship, a value of 1 indicates a strong positive relationship, and a value of 0 indicates no relationship. In Python, you can calculate the correlation using the <strong>corr()</strong> method of the Pandas library.</p><p><strong>Example</strong>:</p><pre>import pandas as pd<br>import numpy as np<br><br>data = {<br>    &#39;x&#39;: [1, 2, 3, 4, 5],<br>    &#39;y&#39;: [2, 4, 6, 8, 10]<br>}<br>df = pd.DataFrame(data)<br>correlation = df.corr()<br>print(correlation)</pre><p><strong>Output</strong></p><pre>x         y<br>x  1.000000  1.000000<br>y  1.000000  1.000000</pre><p>7. <strong>Linear Regression</strong></p><p>Linear regression is a statistical method used to model the relationship between a dependent variable and one or more independent variables. It finds the line of best fit that minimizes the difference between the actual and predicted values. In Python, you can perform linear regression using the <strong>linear_model</strong> module of the Scikit-learn library.</p><p><strong>Example</strong>:</p><pre>import pandas as pd<br>import numpy as np<br>from sklearn.linear_model import LinearRegression<br><br>data = {<br>    &#39;x&#39;: [1, 2, 3, 4, 5],<br>    &#39;y&#39;: [2, 4, 6, 8, 10]<br>}<br>df = pd.DataFrame(data)<br>X = df[&#39;x&#39;].values.reshape(-1, 1)<br>y = df[&#39;y&#39;].values.reshape(-1, 1)<br>reg = LinearRegression().fit(X, y)<br>print(reg.intercept_, reg.coef_)</pre><p>Output: <strong>[0.], [[2.]]</strong></p><p>8. <strong>Probability</strong></p><p>Probability is the study of random events. It is a measure of the likelihood of an event occurring, expressed as a decimal or fraction between 0 and 1. Probability theory is used to model uncertain events and make predictions. In Python, you can use the <strong>math</strong> library to perform probability calculations.</p><p><strong>Example</strong>:</p><pre>import math<br><br>p = 0.5<br>prob = 1 - math.pow(1-p, 6)<br>print(prob)</pre><p><strong>Output</strong>: <strong>0.96875</strong></p><p>In conclusion, these are some of the most important statistical concepts used in data science. Understanding these concepts is crucial for working with data and making informed decisions based on the data.</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em>, </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em>, and</em></strong><em> </em><a href="https://discord.com/invite/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Build awareness and adoption for your tech startup with </em></strong><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cbcca6165df" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/data-science-buzzwords-series-statistics-part-1-1cbcca6165df">Data Science Buzzwords Series: Statistics: Part 1</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Python Topics: Iterators, Generators & Decorators]]></title>
            <link>https://python.plainenglish.io/advanced-python-topics-iterators-generators-decorators-2e2cc30e0b56?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e2cc30e0b56</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python-iterator]]></category>
            <category><![CDATA[python-generators]]></category>
            <category><![CDATA[python-decorators]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 14:10:59 GMT</pubDate>
            <atom:updated>2023-02-14T04:32:32.305Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding the concepts of Iterators, Generators &amp; Decorators in Python.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_DWksyACAFTk9NsvRaCeg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@joshuaryanphoto?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joshua Reddekopp</a> on <a href="https://unsplash.com/photos/SyYmXSDnJ54?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Python is a high-level language that is widely used for web development, data analysis, and artificial intelligence. It provides an extensive set of libraries, tools, and functions to make it easy for developers to perform complex tasks with ease. In this article, we’ll explore some of the advanced topics in Python that can help you take your skills to the next level.</p><p><strong>Iterators</strong></p><p>An iterator is an object that implements the <strong><em>iterator protocol</em></strong>. In other words, it’s an object that can be <strong>iterated </strong>(looped) upon. The iterator protocol consists of two methods: <strong><em>iter()</em></strong> and <strong><em>next()</em></strong>.</p><p>The iter() method returns the iterator object and the next() method returns the next value from the iterator. If there are no more items to return, it should raise StopIteration.</p><p><strong>Example</strong>:</p><pre># Defining a custom iterator class<br>class SquaredNumbers:<br>    def __init__(self, start, end):<br>        self.start = start<br>        self.end = end<br><br>    def __iter__(self):<br>        self.current = self.start<br>        return self<br><br>    def __next__(self):<br>        if self.current &gt;= self.end:<br>            raise StopIteration<br>        else:<br>            self.current += 1<br>            return self.current ** 2<br><br># Using the custom iterator<br>squared_numbers = SquaredNumbers(1, 5)<br>for num in squared_numbers:<br>    print(num)</pre><p><strong>Output</strong></p><pre>4<br>9<br>16<br>25</pre><p>2. <strong>Generators</strong></p><p>A generator is a type of iterator that provides a way to generate a sequence of values, one at a time, as the program is running. In other words, it’s a type of function that returns an iterator. Generators are typically used for producing large amounts of data, as they only generate the values that are actually needed.</p><p><strong>Example</strong>:</p><pre># Defining a custom generator function<br>def squared_numbers(start, end):<br>    current = start<br>    while current &lt; end:<br>        yield current ** 2<br>        current += 1<br><br># Using the custom generator function<br>for num in squared_numbers(1, 5):<br>    print(num)</pre><p><strong>Output</strong></p><pre>1<br>4<br>9<br>16</pre><p>3. <strong>Decorators</strong></p><p>A decorator is a special type of function that wraps another function, adding additional functionality to it. Decorators can be used to modify the behaviour of a function, class, or method. They are a powerful tool for enhancing the functionality of your code.</p><p><strong>Example</strong>:</p><pre># Defining a custom decorator<br>def square_numbers(func):<br>    def wrapper(*args, **kwargs):<br>        result = func(*args, **kwargs)<br>        return result ** 2<br>    return wrapper<br><br># Using the custom decorator<br>@square_numbers<br>def add_numbers(a, b):<br>    return a + b<br><br>result = add_numbers(1, 2)<br>print(result) # 9</pre><p><strong>Output</strong>: 9</p><p><strong>Conclusion</strong></p><p>Iterators, Generators, and Decorators are powerful tools in the Python programming language that allows developers to write <strong><em>efficient </em></strong>and <strong><em>maintainable </em></strong>code. They enable iteration and dynamic functionality, as well as code reuse, making it possible to write code that is easy to understand, maintain and scale. In simple words, <strong>Iterators </strong>allow you to <strong><em>iterate through a collection of items</em></strong>, <strong>Generators </strong>allow you to <strong><em>generate values on the fly</em></strong> and <strong>Decorators </strong>allow you to <strong><em>modify the behaviour of functions or classes without changing their source code</em></strong>.</p><p>I hope this article has helped you understand the concepts of Iterators, Generators &amp; Decorators in Python. If you have any questions or would like to learn more, please don’t hesitate to ask!</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e2cc30e0b56" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/advanced-python-topics-iterators-generators-decorators-2e2cc30e0b56">Advanced Python Topics: Iterators, Generators &amp; Decorators</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Oriented Programming (OOP) in Python — Abstraction & Encapsulation]]></title>
            <link>https://python.plainenglish.io/object-oriented-programming-oop-in-python-abstraction-encapsulation-ffc671cb2b00?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffc671cb2b00</guid>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[oop-python]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 13:58:59 GMT</pubDate>
            <atom:updated>2023-02-13T02:00:52.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>Object Oriented Programming (OOP) in Python — Abstraction &amp; Encapsulation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qiRTBATKa-MtyWWbW-ALEg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/coding?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Abstraction and encapsulation are two crucial concepts of <strong><em>Object Oriented Programming(OOP)</em></strong> in the field of computer science that are used to make code more <strong><em>manageable</em>, <em>secure</em>, </strong>and <strong><em>efficient</em></strong>.</p><p>In this article, we will take a closer look at abstraction and encapsulation in the context of the Python programming language and explain how they work.</p><p><strong>What is Abstraction in Python?</strong></p><p><strong>Abstraction </strong>is a technique that involves <strong><em>hiding the implementation details of a class and only exposing the essential features of the class to the user</em></strong>. This allows the user to work with objects of the class without having to worry about the details of how the class works.</p><p>For example, let’s say we have a class called <strong>Car</strong> that has methods such as <strong>start_engine()</strong>, <strong>accelerate()</strong>, and <strong>brake()</strong>. The user only needs to know that they can start the engine, accelerate, and brake the car, but they don&#39;t need to know how these methods are implemented. Here&#39;s what the code would look like:</p><pre>class Car:<br>    def start_engine(self):<br>        # Implementation details hidden<br>        print(&quot;Engine started&quot;)<br><br>    def accelerate(self):<br>        # Implementation details hidden<br>        print(&quot;Accelerating&quot;)<br><br>    def brake(self):<br>        # Implementation details hidden<br>        print(&quot;Braking&quot;)</pre><p>In this example, the user can use the <strong>Car</strong> class in a straightforward way, without having to worry about the implementation details.</p><p><strong>What is Encapsulation in Python?</strong></p><p>Encapsulation is a technique that involves <strong><em>wrapping data and functions into a single unit or object</em></strong>. This allows you to <strong><em>control the way the data and functions are accessed</em></strong> and helps to prevent accidental modification of the data.</p><p>For example, let’s say we have a class called <strong>BankAccount</strong> that has attributes such as <strong>balance</strong> and <strong>account_number</strong> and methods such as <strong>deposit()</strong> and <strong>withdraw()</strong>. We want to ensure that the balance can only be modified through the <strong>deposit()</strong> and <strong>withdraw()</strong> methods and not directly. Here&#39;s what the code would look like:</p><pre>class BankAccount:<br>    def __init__(self, balance, account_number):<br>        self.__balance = balance<br>        self.__account_number = account_number<br><br>    def deposit(self, amount):<br>        self.__balance += amount<br><br>    def withdraw(self, amount):<br>        if self.__balance &gt;= amount:<br>            self.__balance -= amount<br>        else:<br>            print(&quot;Insufficient funds&quot;)<br><br>    def get_balance(self):<br>        return self.__balance</pre><p>In this example, the <strong>balance</strong> and <strong>account_number</strong> attributes are prefixed with two underscores, which makes them private. This means that they can only be accessed within the <strong>BankAccount</strong> class and not outside of it. The user can only modify the balance through the <strong>deposit()</strong> and <strong>withdraw()</strong> methods, ensuring that the data is secure.</p><blockquote>To learn more about Public &amp; Private methods check out this article <a href="https://medium.com/@mainak17/object-oriented-programming-oop-in-python-public-private-methods-b952f437d0c8">Object Oriented Programming (OOP) in Python — Public &amp; Private Methods</a></blockquote><p><strong>Conclusion</strong></p><p><strong>Abstraction </strong>and <strong>Encapsulation </strong>are important concepts in computer programming that can help you write more manageable, secure, and efficient code.</p><p><strong>Abstraction </strong>involves hiding the implementation details of a class and only exposing the essential features, while <strong>Encapsulation </strong>involves wrapping data and functions into a single unit or object and controlling the way they are accessed.</p><p>In Python, <strong>Abstraction </strong>is achieved by creating classes and hiding the implementation details of the methods.</p><p><strong>Encapsulation </strong>is achieved by making the data and methods <strong>private </strong>and only accessing them through <strong>public </strong>methods.</p><p>By understanding and using <strong><em>abstraction </em></strong>and <strong><em>encapsulation </em></strong>in Python, you can make your code more <strong><em>organized </em></strong>and <strong><em>maintainable</em></strong>, and <strong><em>ensure that your data is protected from accidental modification</em></strong>.</p><p>I hope this article has helped you understand the concepts of abstraction and encapsulation in Python. If you have any questions or would like to learn more, please don’t hesitate to ask!</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em>, </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em>, and</em></strong><em> </em><a href="https://discord.com/invite/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Build awareness and adoption for your tech startup with </em></strong><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffc671cb2b00" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/object-oriented-programming-oop-in-python-abstraction-encapsulation-ffc671cb2b00">Object Oriented Programming (OOP) in Python — Abstraction &amp; Encapsulation</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Oriented Programming (OOP) in Python — Public & Private Methods]]></title>
            <link>https://python.plainenglish.io/object-oriented-programming-oop-in-python-public-private-methods-b952f437d0c8?source=rss-410db4f5a0dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b952f437d0c8</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <dc:creator><![CDATA[Mainak Das]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 13:55:03 GMT</pubDate>
            <atom:updated>2023-02-13T02:00:42.982Z</atom:updated>
            <content:encoded><![CDATA[<h3>Object Oriented Programming (OOP) in Python — Public &amp; Private Methods</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BhOqMs82GDYpB5g4BYHwyA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/de/@amandadalbjorn?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Amanda Dalbjörn</a> on <a href="https://unsplash.com/photos/UbJMy92p8wk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In object-oriented programming, the concept of <strong>visibility </strong>and <strong>access control</strong> refers to the idea of defining which methods and variables are accessible from outside the class, and which are meant to be hidden and used only within the class. This helps to maintain the <strong>encapsulation </strong>of the class and prevent accidental modification of its internal state.</p><p>There are two main types of visibility in OOP: <strong>Private </strong>and <strong>Public</strong>.</p><p><strong>Public Methods</strong></p><p>Public methods are those methods that are accessible from <strong><em>outside the class</em></strong>. These methods can be called by any code that has a reference to an object of the class. Public methods are declared without any visibility keywords and can be used to provide an interface for the class.</p><p>For example, consider the following code:</p><pre>class BankAccount:<br>    def __init__(self, balance, account_number):<br>        self.balance = balance<br>        self.account_number = account_number<br><br>    def deposit(self, amount):<br>        self.balance += amount<br><br>    def withdraw(self, amount):<br>        if self.balance &gt;= amount:<br>            self.balance -= amount<br>        else:<br>            print(&quot;Insufficient funds&quot;)<br><br>    def get_balance(self):<br>        return self.balance</pre><p>In this code, the methods deposit, withdraw, and get_balance are all public methods. Any code that has a reference to a BankAccount object can call these methods.</p><p><strong>Private Methods</strong></p><p>Private methods, on the other hand, are meant to be used only within the class and are not accessible from outside the class. In Python, private methods are denoted by a double underscore prefix (__) before the method name.</p><p>For example:</p><pre>class BankAccount:<br>    def __init__(self, balance, account_number):<br>        self.__balance = balance<br>        self.__account_number = account_number<br><br>    def deposit(self, amount):<br>        self.__balance += amount<br><br>    def withdraw(self, amount):<br>        if self.__balance &gt;= amount:<br>            self.__balance -= amount<br>        else:<br>            print(&quot;Insufficient funds&quot;)<br><br>    def __validate_transaction(self, amount):<br>        if self.__balance &gt;= amount:<br>            return True<br>        else:<br>            return False</pre><p>In this code, the method __validate_transaction is a private method. It can only be called from within the BankAccount class, not from outside the class. This helps to prevent accidental modification of the internal state of the class.</p><p>It’s important to note that while private methods are not directly accessible from outside the class, they can still be called if the internal implementation of the class changes. This is why it’s a best practice to use private methods only for internal implementation details that are not meant to be part of the public interface of the class.</p><p><strong>Bonus Section</strong></p><p>There is also something called <strong>protected methods</strong> which are methods that are designated as being more restricted than public methods, but not as restricted as private methods. Protected methods can be called within the same class and its subclasses, but are not meant to be called from outside of the class hierarchy.</p><p>Protected methods are typically used to ensure that a subclass can access and modify the state of an object in a controlled way. This can help to prevent the subclass from making unintended changes that could break the behaviour of the object.</p><p>In Python, protected methods are designated using a single underscore before the method name, for example:</p><pre>class BankAccount:<br>    def __init__(self, balance, account_number):<br>        self._balance = balance<br>        self._account_number = account_number<br><br>    def deposit(self, amount):<br>        self._balance += amount<br><br>    def withdraw(self, amount):<br>        if self._balance &gt;= amount:<br>            self._balance -= amount<br>        else:<br>            print(&quot;Insufficient funds&quot;)<br><br>    def _get_balance(self):<br>        return self._balance</pre><p>In the example above, the _get_balance method is a protected method, which means it can be accessed and used by the BankAccount class and its subclasses, but not by any other code outside of the class hierarchy.</p><p><strong>Conclusion</strong></p><p>In this article, we explored the concepts of <strong>private</strong>, <strong>public</strong>, and <strong>protected </strong>methods in object-oriented programming. Understanding these concepts is essential for creating clean and well-structured code that is easy to maintain and scale.</p><p><strong><em>Private methods</em></strong>, designated with <strong><em>two underscores before the method name</em></strong>, are intended to be used only within the class and are <strong><em>not meant to be accessed from outside the class</em></strong>. This helps to protect the internal state of the object from being modified in unintended ways.</p><p><strong><em>Public methods</em></strong>, on the other hand, are intended to be used by <strong><em>any code that has access to an object</em></strong>. These methods provide the interface for interacting with the object and are meant to be used by other code to get or modify the state of the object.</p><p><strong><em>Protected methods</em></strong>, designated with <strong><em>a single underscore before the method name</em></strong>, are intended to be used within the class and its subclasses. These methods provide a controlled way for subclasses to access and modify the state of an object.</p><p>By understanding the difference between private, public, and protected methods, you can write better-structured and more maintainable code that is easier to understand and scale over time.</p><p>I hope this article has helped you understand the concepts of private, public, and protected methods in OOP Python. If you have any questions or would like to learn more, please don’t hesitate to ask!</p><p>Thank you for reading till the end. You can follow me <a href="https://medium.com/@mainak17">here </a>on Medium for more updates.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em>, </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em>, and</em></strong><em> </em><a href="https://discord.com/invite/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Build awareness and adoption for your tech startup with </em></strong><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b952f437d0c8" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/object-oriented-programming-oop-in-python-public-private-methods-b952f437d0c8">Object Oriented Programming (OOP) in Python — Public &amp; Private Methods</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>