<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Christopher Ambala</title>
    <description>The latest articles on DEV Community by Christopher Ambala (@parq254).</description>
    <link>https://dev.to/parq254</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1171332%2Fa4459ee7-d905-41be-84ec-222584eea280.jpeg</url>
      <title>DEV Community: Christopher Ambala</title>
      <link>https://dev.to/parq254</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parq254"/>
    <language>en</language>
    <item>
      <title>Python List Cheat Sheet</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Wed, 10 Apr 2024 12:02:20 +0000</pubDate>
      <link>https://dev.to/parq254/python-data-typelist-23j7</link>
      <guid>https://dev.to/parq254/python-data-typelist-23j7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A list is an ordered,mutable and heterogeneous collection of items&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Creating a list
&lt;/h3&gt;

&lt;p&gt;We use the syntax &lt;code&gt;my_list&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = ['apple','banana','cherry']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accessing List Items
&lt;/h3&gt;

&lt;p&gt;The index number is used in reference, starting from index 0 and second item being 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;first_item = my_list[0]
print(first_item)  #Outputs: apple
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modifying List Items
&lt;/h3&gt;

&lt;p&gt;This is done by referring to their index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list[1] = 'blueberry'
print(my_list) #Outputs:['apple','blueberry','cherry']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List Comprehension
&lt;/h3&gt;

&lt;p&gt;It's a syntactic construct that enables list to be created from other lists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_list = [expression for item in iterable if condition]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;expression&lt;/code&gt; is an operation applied to each item in the &lt;code&gt;iterable&lt;/code&gt; that satisfies the &lt;code&gt;condition&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;item&lt;/code&gt; is a variable used to represent members of the &lt;code&gt;iterable&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;iterable&lt;/code&gt; is a sequence, collection, or an iterator object to be traversed.&lt;br&gt;
&lt;code&gt;condition&lt;/code&gt; is an optional filter that only includes &lt;code&gt;item&lt;/code&gt; in the &lt;code&gt;new_list&lt;/code&gt; if the condition is &lt;code&gt;True&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;squares = [x**2 for x in range(10) if x % 2 == 0]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will result in squares being a list of the squares of all even numbers from 0 to 9: &lt;code&gt;[0, 4, 16, 36, 64]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;List comprehensions are a powerful feature of Python and can make your code more readable and efficient.&lt;/p&gt;

&lt;h3&gt;
  
  
  List Operations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;append()&lt;/code&gt;: Adds an element at the end of the list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;extend()&lt;/code&gt;: Add the elements of a list (or any iterable), to the end of the current list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;insert()&lt;/code&gt;: Adds an element at the specified position.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;remove()&lt;/code&gt;: Removes the item with the specified value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pop()&lt;/code&gt;: Removes the element at the specified position.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index()&lt;/code&gt;: Returns the index of the first element with the specified value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;count()&lt;/code&gt;: Returns the number of times a value appears in the list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sort()&lt;/code&gt;: Sorts the list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reverse()&lt;/code&gt;: Reverses the order of the list.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a list
fruits = ["apple", "banana", "cherry"]

# Add an element to the end of the list
fruits.append("orange")

# Add multiple elements to the end of the list
fruits.extend(["kiwi", "mango"])

# Add an element at a specific position
fruits.insert(1, "pineapple")

# Remove an element from the list
fruits.remove("banana")

# Remove the last element in the list
last_fruit = fruits.pop()

# Get the index of the first occurrence of an element
index_of_cherry = fruits.index("cherry")

# Count the number of times an element appears in the list
num_apples = fruits.count("apple")

# Sort the list
fruits.sort()

# Reverse the list
fruits.reverse()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List Concatenation
&lt;/h3&gt;

&lt;p&gt;Can Be done in three ways;&lt;br&gt;
Using the &lt;code&gt;+&lt;/code&gt; Operator: This is the most straightforward method. The &lt;code&gt;+&lt;/code&gt; operator can be used to add together two lists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = [1, 2, 3]
list2 = [4, 5, 6]
combined = list1 + list2  # combined is now [1, 2, 3, 4, 5, 6]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the &lt;code&gt;extend()&lt;/code&gt; Method: The &lt;code&gt;extend()&lt;/code&gt; method adds elements from another list (or any iterable) to the end of the current list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = [1, 2, 3]
list2 = [4, 5, 6]
list1.extend(list2)  # list1 is now [1, 2, 3, 4, 5, 6]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using List Comprehension: This is a more advanced method that involves creating a new list based on existing lists. It’s a concise way to create lists based on existing lists (or other iterables)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = [1, 2, 3]
list2 = [4, 5, 6]
combined = [item for sublist in [list1, list2] for item in sublist]  # combined is now [1, 2, 3, 4, 5, 6]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>softwareengineering</category>
      <category>computerscience</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Dictionaries The Python Guide</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Mon, 01 Apr 2024 10:05:40 +0000</pubDate>
      <link>https://dev.to/parq254/python-data-typedictionary-5g64</link>
      <guid>https://dev.to/parq254/python-data-typedictionary-5g64</guid>
      <description>&lt;p&gt;A dictionary in Python is an unordered collection of key-value pairs. Each item in the dictionary has a key, and each key maps to a unique value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dictionary
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;student = {
    "name": "John Doe",
    "age": 20,
    "grade": "Sophomore"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;"name"&lt;/code&gt;, &lt;code&gt;"age"&lt;/code&gt;, and &lt;code&gt;"grade"&lt;/code&gt; are keys, and &lt;code&gt;"John Doe"&lt;/code&gt;, &lt;code&gt;20&lt;/code&gt;, and &lt;code&gt;"Sophomore"&lt;/code&gt; are their respective values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Characteristics
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unordered:&lt;/strong&gt; Dictionaries are unordered, meaning the items do not have a defined order. The order of items can change over time, making the index of each item unreliable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mutable:&lt;/strong&gt; Dictionaries are mutable. This means you can change, add, and remove items after the dictionary is created.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indexed by Keys:&lt;/strong&gt; Unlike lists, which are indexed by a range of numbers, dictionaries are indexed by keys. This key-value pair system makes dictionaries incredibly versatile for storing and organizing data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cannot Contain Duplicate Keys:&lt;/strong&gt; Each key in a dictionary must be unique. If a duplicate key is assigned a value, the original key’s value will be overwritten.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Dictionary Creation
&lt;/h3&gt;

&lt;p&gt;Dictionaries are created by enclosing key-value pairs in curly braces &lt;code&gt;{}&lt;/code&gt;.&lt;br&gt;
A colon &lt;code&gt;:&lt;/code&gt; separates keys from its associate value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person = {"name": "Alice", "age": 25}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accessing Elements
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(person["name"])  # Output: Alice

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modifying Elements
&lt;/h3&gt;

&lt;p&gt;Dictionaries are mutable. You can change the value of a specific item by referring to its key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dictionaries are mutable. You can change the value of a specific item by referring to its key.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding Elements
&lt;/h3&gt;

&lt;p&gt;Adding an item to the dictionary is done by using a new index key and assigning a value to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person["city"] = "New York"
print(person)  # Output: {'name': 'Alice', 'age': 30, 'city': 'New York'}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Removing Elements
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;del&lt;/code&gt; statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;del person["age"]
print(person)  # Output: {'name': 'Alice', 'city': 'New York'}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Making a copy
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;copy&lt;/code&gt; keyword&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y = x.copy()
print(y)  # Output: {'one': 'uno', 'two': 2, 'three': 3}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Removing all items
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;clear&lt;/code&gt; keyword&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x.clear()
print(x)  # Output: {}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Getting the Number of Items
&lt;/h3&gt;

&lt;p&gt;Use the &lt;code&gt;len()&lt;/code&gt; keyword&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x.clear()
print(x)  # Output: {}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Looping Over values
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for item in y.values():
    print(item)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using &lt;code&gt;if&lt;/code&gt; statement to get values
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if "one" in y:
    print(y['one'])  # Output: uno
if "two" not in y:
    print("Two not found")
if "three" in y:
    del y['three']

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python dictionaries are a flexible and efficient data type that allow you to organize and manipulate data effectively. They are a fundamental part of Python and understanding them is crucial to becoming proficient in the language. Whether you’re storing configuration settings, managing data in a web application, or even building complex data structures, Python dictionaries are an excellent tool to have in your programming toolkit.&lt;/p&gt;

</description>
      <category>python</category>
      <category>pythondataatypes</category>
      <category>coding</category>
    </item>
    <item>
      <title>Boolean,The Truth and False Of Python</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Mon, 25 Mar 2024 14:29:22 +0000</pubDate>
      <link>https://dev.to/parq254/python-data-typesboolean-44hk</link>
      <guid>https://dev.to/parq254/python-data-typesboolean-44hk</guid>
      <description>&lt;p&gt;The Python Boolean type has only two possible values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;True&lt;/li&gt;
&lt;li&gt;False
No other value will have bool as its type. You can check the type of &lt;code&gt;True&lt;/code&gt; and &lt;code&gt;False&lt;/code&gt; with the built-in type():
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; type(False)
&amp;lt;class 'bool'&amp;gt;
&amp;gt;&amp;gt;&amp;gt; type(True)
&amp;lt;class 'bool'&amp;gt;

Input: 1==1
Output: True 

Input: 2&amp;lt;1 
Output: False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Evaluate Variables and Expressions
&lt;/h3&gt;

&lt;p&gt;Bools can be evaluated values and variables using the Python bool() function. This method is used to return or convert a value to a Boolean value i.e., True or False,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bool([x])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python bool() Function
&lt;/h3&gt;

&lt;p&gt;Booleans can be evaluated using the bool() function as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to illustrate
# built-in method bool()

# Returns False as x is not equal to y
x = 5
y = 10
print(bool(x==y))

# Returns False as x is None
x = None
print(bool(x))

# Returns False as x is an empty sequence
x = ()
print(bool(x))

# Returns False as x is an empty mapping
x = {}
print(bool(x))

# Returns False as x is 0
x = 0.0
print(bool(x))

# Returns True as x is a non empty string
x = 'Greatest'
print(bool(x))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;False
False
False
False
False
True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Convertion of Integers and Floats as Booleans
&lt;/h3&gt;

&lt;p&gt;Numbers can be converted as bool values by using Python’s built-in bool() method. Any integer, floating-point number, or complex number having zero as a value is considered as False, while if they are having value as any positive or negative number then it is considered as True.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var1 = 0
print(bool(var1))

var2 = 1
print(bool(var2))

var3 = -9.7
print(bool(var3))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;False
True
True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Boolean Operators
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;or&lt;/li&gt;
&lt;li&gt;and&lt;/li&gt;
&lt;li&gt;not&lt;/li&gt;
&lt;li&gt;== (equivalent)&lt;/li&gt;
&lt;li&gt;!= (not equivalent)
###Boolean OR Operator
The Boolean or operator returns True if any one of the inputs is True else returns False.
###syntax:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# or operator

a = 1
b = 2
c = 4

if a &amp;gt; b or b &amp;lt; c:
    print(True)
else:
    print(False)

if a or b or c:
    print("Atleast one number has boolean value as True")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;True
Atleast one number has boolean value as True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Boolean And Operator
&lt;/h3&gt;

&lt;p&gt;The Boolean operator returns False if any one of the inputs is False else returns True.&lt;br&gt;
&lt;strong&gt;syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# and operator

a = 0
b = 2
c = 4

if a &amp;gt; b and b&amp;lt;c:
    print(True)
else:
    print(False)

if a and b and c:
    print("All the numbers has boolean value as True")
else:
    print("Atleast one number has boolean value as False")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;False
Atleast one number has boolean value as False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Boolean Not Operator
&lt;/h3&gt;

&lt;p&gt;The Boolean Not operator only requires one argument and returns the negation of the argument i.e. returns the True for False and False for True.&lt;br&gt;
&lt;strong&gt;syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# not operator

a = 0

if not a:
    print("Boolean value of a is False")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Boolean value of a is False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Boolean == (equivalent) and != (not equivalent) Operator
&lt;/h3&gt;

&lt;p&gt;Both operators are used to compare two results. == (equivalent operator returns True if two results are equal and != (not equivalent operator returns True if the two results are not same.&lt;br&gt;
&lt;strong&gt;syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# equivalent an not equivalent
# operator

a = 0
b = 1

if a == 0:
    print(True)

if a == b:
    print(True)

if a != b:
    print(True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;True
True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python is Operator
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Is&lt;/code&gt; is used to test whether two variables belong to the same object. The test will return True if the two objects are the same else it will return False even if the two objects are 100% equal.&lt;br&gt;
&lt;strong&gt;syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# is keyword


x = 10
y = 10

if x is y:
    print(True)
else:
    print(False)

x = ["a", "b", "c", "d"]
y = ["a", "b", "c", "d"]

print(x is y)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;True
False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python in Operator
&lt;/h3&gt;

&lt;p&gt;in operator checks for the membership i.e. checks if the value is present in a list, tuple, range, string.&lt;br&gt;
&lt;strong&gt;syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Python program to demonstrate
# in keyword

# Create a list
animals = ["dog", "lion", "cat"]

# Check if lion in list or not
if "lion" in animals:
    print(True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Python Strings In A Nutshell</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Mon, 18 Mar 2024 18:00:03 +0000</pubDate>
      <link>https://dev.to/parq254/stringsstrings-2g35</link>
      <guid>https://dev.to/parq254/stringsstrings-2g35</guid>
      <description>&lt;p&gt;Strings are enclosed within single &lt;code&gt;(' ')&lt;/code&gt;, double &lt;code&gt;(" ")&lt;/code&gt;, or triple &lt;code&gt;(''' ''' or """ """)&lt;/code&gt; quotes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;single_quoted = 'This is a single-quoted string.'
double_quoted = "This is a double-quoted string."
triple_quoted = '''This is a triple-quoted string.'''
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Immutability
&lt;/h3&gt;

&lt;p&gt;They cannot be changed in-place after they are created. For example, you can’t change a string by assigning to one of its&lt;br&gt;
positions, but you can always build a new one and assign it to the same name.&lt;/p&gt;
&lt;h3&gt;
  
  
  Concatenation and Slicing
&lt;/h3&gt;

&lt;p&gt;Python allows you to concatenate strings using the + operator, making it easy to combine text elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;first_name = "John"
last_name = "Doe"
full_name = first_name + " " + last_name  # full_name is "John Doe"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = "Hello, World!"
first_char = text[0]  # first_char is 'H'
substring = text[7:12]  # substring is 'World'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every object in Python is classified as either immutable (unchangeable) or not. In terms of the core types, numbers, strings, and tuples are immutable; lists and dictionaries are&lt;br&gt;
not.&lt;/p&gt;
&lt;h3&gt;
  
  
  String Operations
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; match = re.match('/(.*)/(.*)/(.*)', '/usr/home/lumberjack')
&amp;gt;&amp;gt;&amp;gt; match.groups()
('usr', 'home', 'lumberjack')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S[-1] # The last item from the end in S
'm'
&amp;gt;&amp;gt;&amp;gt; S[-2] # The second to last item from the end
'a'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;A negative index is simply added to the string’s size,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S[-1] # The last item in S
'm'
&amp;gt;&amp;gt;&amp;gt; S[len(S)-1] # Negative indexing, the hard way
'm'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sequences also support a more general form of indexing,slicing, which is a way to extract an entire section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S # A 4-character string
'Spam'
&amp;gt;&amp;gt;&amp;gt; S[1:3] # Slice of S from offsets 1 through 2 (not 3)
'pa'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The general form, &lt;code&gt;X[I:J]&lt;/code&gt;, means “give me everything in X from offset I up to but not including offset J.” The result is returned in a new object. The second of the preceding operations, for instance, gives us all the characters in string S from offsets 1 through 2 (that is, 3 – 1) as a new string. The effect is&lt;br&gt;
to slice or “parse out” the two characters in the middle.&lt;br&gt;
In a slice, the left bound defaults to zero, and the right bound defaults to the length of&lt;br&gt;
the sequence being sliced. This leads to some common usage variations:&lt;/p&gt;

&lt;p&gt;Addition for(+)numbers, and concatenation for strings. This is a general property of Python that is called polymorphism.&lt;/p&gt;
&lt;h3&gt;
  
  
  Methods In String
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S.find('pa') # Find the offset of a substring
1
&amp;gt;&amp;gt;&amp;gt; S
'Spam'
&amp;gt;&amp;gt;&amp;gt; S.replace('pa', 'XYZ') # Replace occurrences of a substring with another
'SXYZm'
&amp;gt;&amp;gt;&amp;gt; S
'Spam'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S[1:] # Everything past the first (1:len(S))
'pam'
&amp;gt;&amp;gt;&amp;gt; S # S itself hasn't changed
'Spam'
&amp;gt;&amp;gt;&amp;gt; S[0:3] # Everything but the last
'Spa'
&amp;gt;&amp;gt;&amp;gt; S[:3] # Same as S[0:3]
'Spa'
&amp;gt;&amp;gt;&amp;gt; S[:-1] # Everything but the last again, but simpler (0:-1)
'Spa'
&amp;gt;&amp;gt;&amp;gt; S[:] # All of S as a top-level copy (0:len(S))
'Spam'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Strings also support concatenation with the plus sign and repetition :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; S
Spam'
&amp;gt;&amp;gt;&amp;gt; S + 'xyz' # Concatenation
Strings | 81
'Spamxyz'
&amp;gt;&amp;gt;&amp;gt; S # S is unchanged
'Spam'
&amp;gt;&amp;gt;&amp;gt; S * 8 # Repetition
'SpamSpamSpamSpamSpamSpamSpamSpam'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; line = 'aaa,bbb,ccccc,dd'
&amp;gt;&amp;gt;&amp;gt; line.split(',') # Split on a delimiter into a list of substrings
['aaa', 'bbb', 'ccccc', 'dd']
&amp;gt;&amp;gt;&amp;gt; S = 'spam'
&amp;gt;&amp;gt;&amp;gt; S.upper() # Upper- and lowercase conversions
'SPAM'
&amp;gt;&amp;gt;&amp;gt; S.isalpha() # Content tests: isalpha, isdigit, etc.
True
&amp;gt;&amp;gt;&amp;gt; line = 'aaa,bbb,ccccc,dd\n'
&amp;gt;&amp;gt;&amp;gt; line = line.rstrip() # Remove whitespace characters on the right side
&amp;gt;&amp;gt;&amp;gt; line
'aaa,bbb,ccccc,dd'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pattern Matching
&lt;/h3&gt;

&lt;p&gt;This module has analogous calls for searching, splitting, and replacement, but because we can use patterns to specify substrings, we can be much more general:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import re
&amp;gt;&amp;gt;&amp;gt; match = re.match('Hello[ \t]*(.*)world', 'Hello Python world')
&amp;gt;&amp;gt;&amp;gt; match.group(1)
'Python '
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example searches for a substring that begins with the word “Hello,” followed by zero or more tabs or spaces, followed by arbitrary characters to be saved as a matched group, terminated by the word “world.”The following pattern, picks out three groups separated by slashes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; match = re.match('/(.*)/(.*)/(.*)', '/usr/home/lumberjack')
&amp;gt;&amp;gt;&amp;gt; match.groups()
('usr', 'home', 'lumberjack')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>python</category>
      <category>learning</category>
      <category>coding</category>
    </item>
    <item>
      <title>The 123 of Python Integers</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Mon, 11 Mar 2024 13:39:15 +0000</pubDate>
      <link>https://dev.to/parq254/python-data-types-2hpp</link>
      <guid>https://dev.to/parq254/python-data-types-2hpp</guid>
      <description>&lt;p&gt;Today we look at core python data types which are;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Int&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Integer data type
&lt;/h3&gt;

&lt;p&gt;Integers in Python are represented by the int data type (the abbreviation int comes from the word integer). To determine an integer of type int, a sequence of digits from 0 to 9 is used.&lt;/p&gt;

&lt;p&gt;An explicitly specified numeric value in the program code is called an integer literal. When Python encounters an integer literal, it creates an int object that stores the specified value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = 17 # integer literal
m = 7 # integer literal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The integer data type int is used not only because it occurs in the real world, but also because it naturally occurs when creating most programs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Converting a string to an integer
&lt;/h3&gt;

&lt;p&gt;To convert a string to an integer, we use the &lt;code&gt;int()&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num = int(input()) # converting a read string to an integer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is not necessary to use the input() command to convert a string to an integer.&lt;/p&gt;

&lt;p&gt;The following code converts the string 12345 to an integer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = int('12345') # convert string to integer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the string is not a number, an error will occur during the conversion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integer operators
&lt;/h3&gt;

&lt;p&gt;Python provides four basic arithmetic operators for working with integers (+, −, &lt;em&gt;, /), and also three additional ones (% for remainder, // for integer division and *&lt;/em&gt; for exponentiation).&lt;/p&gt;

&lt;p&gt;The following program demonstrates all integer operators:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 13
b = 7

total = a + b
diff = a - b
prod = a * b
div1 = a / b
div2 = a // b
mod = a % b
exp = a ** b

print(a, '+', b, '=', total)
print(a, '-', b, '=', diff)
print(a, '*', b, '=', prod)
print(a, '/', b, '=', div1)
print(a, '//', b, '=', div2)
print(a, '%', b, '=', mod)
print(a, '**', b, '=', exp)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a result of the operation of such a program , it will be output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;13 + 7 = 20
13–7 = 6
13 * 7 = 91
13 / 7 = 1.8571428571428572
13 // 7 = 1
13 % 7 = 6
13 ** 7 = 62748517
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the usual division (/), a number that is not an integer is obtained. Dividing by zero leads to an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Long arithmetic
&lt;/h3&gt;

&lt;p&gt;A distinctive feature of the Python language is the unlimited integer data type. In fact, the size of the number depends only on the availability of free memory on the computer. This distinguishes Python from languages such as C++, C, C#, Java where variables of the whole data type have a limitation. For example, in C#, the range of integers is limited from −263−263 to 263–1263–1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;atom = 10 ** 80 # number of atoms in the universe
print('Number of atoms =', atom)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of the program will be a number with 81 digits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Number of atoms = 100000000000000000000000000000000000000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Separator character
&lt;/h3&gt;

&lt;p&gt;For easy reading of numbers, you can use the underscore character:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num1 = 25_000_000
num2 = 25000000
print(num1)
print(num2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of executing such code will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;25000000
25000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Floating point numbers
&lt;/h3&gt;

&lt;p&gt;Along with integers in Python, it is possible to work with fractional (real) numbers. So, for example, the numbers 2/3, π — are real and the integer type int is not enough to represent them.&lt;/p&gt;

&lt;p&gt;Fractional (real) numbers in computer science are called float point numbers.&lt;/p&gt;

&lt;p&gt;Python uses the float data type to represent floating-point numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;e = 2.71828 #floating point literal
pi = 3.1415 #floating point literal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike mathematics, where the separator is a comma, in computer science a dot is used.&lt;/p&gt;

&lt;h3&gt;
  
  
  Converting a string to a floating point number
&lt;/h3&gt;

&lt;p&gt;To convert a string to a floating-point number, we use the float() command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num = float(input()) #converting a read string to a floating-point number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is not necessary to use the &lt;em&gt;input()&lt;/em&gt; command to convert a string to a floating-point number.&lt;/p&gt;

&lt;p&gt;The following code converts the string 1.2345 to a floating point number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = float('1.2345') #converting a string to a floating-point number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the string is not a number, an error will occur during the conversion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Arithmetic operators
&lt;/h3&gt;

&lt;p&gt;Python provides four basic arithmetic operators for working with floating−point numbers (+, -, &lt;em&gt;, /) and one additional (&lt;/em&gt;* for exponentiation).&lt;/p&gt;

&lt;p&gt;The following program demonstrates arithmetic operators:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 13.5
b = 2.0

total = a + b
diff = a - b
prod = a * b
div = a / b
exp = a ** b

print(a, '+', b, '=', total)
print(a, '-', b, '=', diff)
print(a, '*', b, '=', prod)
print(a, '/', b, '=', div)
print(a, '**', b, '=', exp)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a result of the operation of such a program , it will be output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;13.5 + 2.0 = 15.5
13.5–2.0 = 11.5
13.5 * 2.0 = 27.0
13.5 / 2.0 = 6.75
13.5 ** 2.0 = 182.25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dividing by zero leads to an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conversion between int and float
&lt;/h3&gt;

&lt;p&gt;Implicit conversion. Any integer (int type) can be used where a floating-point number (float type) is expected, because Python automatically converts integers to floating-point numbers if necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explicit conversion.&lt;/strong&gt; A floating-point number cannot be implicitly converted to an integer. For such a conversion, it is necessary to use an explicit conversion using the &lt;em&gt;int()&lt;/em&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num1 = 17.89
num2 = -13.56
num3 = int(num1)
num4 = int(num2)

print(num3)
print(num4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of executing such code will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;17
-13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the conversion of floating-point numbers to an integer is performed with rounding towards zero, that is &lt;strong&gt;int(1.7) = 1, int(-1.7) = -1.&lt;/strong&gt;For further reading refer to the &lt;a href="https://docs.python.org/3/library/functions.html#int" rel="noopener noreferrer"&gt;Python Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>coding</category>
      <category>discuss</category>
      <category>python</category>
    </item>
    <item>
      <title>Python Tuples</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Mon, 04 Mar 2024 08:55:08 +0000</pubDate>
      <link>https://dev.to/parq254/python-data-types-1d77</link>
      <guid>https://dev.to/parq254/python-data-types-1d77</guid>
      <description>&lt;p&gt;It's been a while since my last post😐,But I'm back with interesting python topics as I learn😃&lt;br&gt;
Today we look at core python data types which are;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tuples&lt;/li&gt;
&lt;li&gt;Int&lt;/li&gt;
&lt;li&gt;Lists&lt;/li&gt;
&lt;li&gt;Dictionaries&lt;/li&gt;
&lt;li&gt;Numbers&lt;/li&gt;
&lt;li&gt;sets&lt;/li&gt;
&lt;li&gt;File&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Tuples
&lt;/h3&gt;

&lt;p&gt;Tuples are ordered collections of heterogeneous data that are unchangeable.&lt;br&gt;
They have the following characteristics;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl32xed1virpp5db6q02e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl32xed1virpp5db6q02e.png" alt="tuples" width="720" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ordered:&lt;/strong&gt; Tuples are part of sequence data types, which means they hold the order of the data insertion. It maintains the index value for each item.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unchangeable:&lt;/strong&gt; Tuples are unchangeable, which means that we cannot add or delete items to the tuple after creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heterogeneous:&lt;/strong&gt; Tuples are a sequence of data of different data types (like integer, float, list, string, etc;) and can be accessed through indexing and slicing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contains Duplicates:&lt;/strong&gt; Tuples can contain duplicates, which means they can have items with the same value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Creating tuples&lt;/strong&gt;&lt;br&gt;
They are created using &lt;code&gt;()&lt;/code&gt; or the built in function &lt;code&gt;tuple ()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Using empty parentheses
mytuple = ()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Using tuple() function
mytuple = tuple()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating a tuple with elements.
&lt;/h3&gt;

&lt;p&gt;A tuple is created by placing all the items (elements) inside parentheses, separated by commas. The parentheses are optional, however, it is a good practice to use them.&lt;/p&gt;

&lt;p&gt;A tuple can have any number of items and they may be of different types (integer, float, list, string, etc.).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Different types of tuples
# Empty tuple
my_tuple = ()
print(my_tuple)

# Tuple having integers
my_tuple = (1, 2, 3)
print(my_tuple)

# tuple with mixed datatypes
my_tuple = (1, "Hello", 3.4)
print(my_tuple)

# nested tuple
my_tuple = ("mouse", [8, 4, 6], (1, 2, 3))
print(my_tuple)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;()
(1, 2, 3)
(1, 'Hello', 3.4)
('mouse', [8, 4, 6], (1, 2, 3))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using the &lt;code&gt;tuple()&lt;/code&gt; constructor.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tuple([iterable])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tuple packing and unpacking:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Packing:&lt;/strong&gt; Packing is the process of putting values into a tuple. You can create a tuple by separating values with commas, and Python will automatically pack them into a tuple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Packing
my_tuple = 1, 2, 'three', 4.0
print(my_tuple)  # Output: (1, 2, 'three', 4.0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Unpacking:&lt;/strong&gt; Unpacking is the process of extracting values from a tuple. You can assign the elements of a tuple to multiple variables in a single line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Unpacking
a, b, c, d = my_tuple
print(a)  # Output: 1
print(b)  # Output: 2
print(c)  # Output: 'three'
print(d)  # Output: 4.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accessing tuples by index.
&lt;/h3&gt;

&lt;p&gt;To access an item through its index, you can use the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tuple_object[index]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Creating a tuple
my_tuple = (1, 2, 'three', 4.0)

# Accessing elements using indexing
first_element = my_tuple[0]
second_element = my_tuple[1]
third_element = my_tuple[2]
fourth_element = my_tuple[3]

# Printing the elements
print("First element:", first_element)   # Output: 1
print("Second element:", second_element)  # Output: 2
print("Third element:", third_element)    # Output: 'three'
print("Fourth element:", fourth_element)  # Output: 4.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;using a negative index;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Accessing elements using negative indexing
last_element = my_tuple[-1]    # Equivalent to my_tuple[3]
second_last = my_tuple[-2]     # Equivalent to my_tuple[2]

# Printing the elements
print("Last element:", last_element)       # Output: 4.0
print("Second last element:", second_last)  # Output: 'three'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Retrieving Multiple elements in tuples.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tuple_object[start:stop:step]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt;: The index where the slice begins.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;stop&lt;/code&gt;: The index where the slice ends (exclusive).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;step&lt;/code&gt;: The step or stride between elements.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_tuple = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

# Slicing from index 2 to index 7 (exclusive) with a step of 2
sliced_tuple = my_tuple[2:7:2]

print(sliced_tuple)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Output

(3, 5, 7)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What happens if you index out of range.
&lt;/h3&gt;

&lt;p&gt;If you use an index greater than or equal to the tuple’s length, then you get an IndexError exception:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_tuple = (1, 2, 'three', 4.0)
print(my_tuple[5])


Traceback (most recent call last):
    ...
IndexError: tuple index out of range
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accessing elements within a nested tuple.
&lt;/h3&gt;

&lt;p&gt;Accessing elements within nested tuples involves using multiple levels of indexing. Each level of nesting requires an additional set of square brackets to access the desired element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Creating a nested tuple
nested_tuple = (1, 2, (3, 4), ('five', 6))

# Accessing elements in the nested tuple
first_element = nested_tuple[0]
third_element_nested = nested_tuple[2]
first_element_nested = nested_tuple[2][0]
second_element_nested = nested_tuple[3][1]

# Printing the accessed elements
print("First element:", first_element)                 
 # Output: 1

print("Third element (nested tuple):", third_element_nested) 
 # Output: (3, 4)

print("First element of the nested tuple:", first_element_nested) 
 # Output: 3

print("Second element of the nested tuple:", second_element_nested) 
 # Output: 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tuple concatenation
&lt;/h3&gt;

&lt;p&gt;You can concatenate two tuples in Python using the + operator. The result will be a new tuple that contains the elements of both original tuples.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pythonCopy code

# Two tuples to be concatenated
tuple1 = (1, 2, 3)
tuple2 = ('four', 'five', 'six')

# Concatenating the two tuples
concatenated_tuple = tuple1 + tuple2

# Printing the concatenated tuple
print("Concatenated Tuple:", concatenated_tuple)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Output

Concatenated Tuple: (1, 2, 3, 'four', 'five', 'six')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Compare two tuples
&lt;/h3&gt;

&lt;p&gt;In Python, you can compare two tuples using the comparison operators &lt;code&gt;(==, !=, &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=)&lt;/code&gt;. The comparison is performed element-wise, starting from the first element, and stops as soon as a decisive result is reached.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tuple1 = (1, 2, 3)
tuple2 = (1, 2, 4)

# Equality check
print("tuple1 == tuple2:", tuple1 == tuple2)  # Output: False


# Inequality check
print("tuple1 != tuple2:", tuple1 != tuple2)  # Output: True


# Less than check
print("tuple1 &amp;lt; tuple2:", tuple1 &amp;lt; tuple2)    # Output: True

# Greater than check
print("tuple1 &amp;gt; tuple2:", tuple1 &amp;gt; tuple2)    # Output: False


# Less than or equal to check
print("tuple1 &amp;lt;= tuple2:", tuple1 &amp;lt;= tuple2)  # Output: True


# Greater than or equal to check
print("tuple1 &amp;gt;= tuple2:", tuple1 &amp;gt;= tuple2)  # Output: False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using tuple packing and unpacking to return multiple values from a function
&lt;/h3&gt;

&lt;p&gt;Tuple packing and unpacking in Python can be used to return multiple values from a function. This is a convenient way to bundle multiple values together and then easily unpack them when needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_coordinates():
    x = 10
    y = 20
    z = 30
    # Tuple packing
    return x, y, z


# Function call
result = get_coordinates()

# Result is a tuple
print(result)  


# Output: (10, 20, 30)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tuple Unpacking: When calling the function, you can unpack the returned tuple into individual variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_coordinates():
    x = 10
    y = 20
    z = 30
    return x, y, z

# Tuple unpacking
x_result, y_result, z_result = get_coordinates()

# Individual values
print("X:", x_result)  

# Output: 10

print("Y:", y_result) 

 # Output: 20

print("Z:", z_result) 

 # Output: 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a brief introduction into Tuples For further reading this &lt;a href="https://docs.python.org/3/library/stdtypes.html#tuples" rel="noopener noreferrer"&gt;Python Documentation&lt;/a&gt; will be in depth of what I have covered.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Data Engineering For Beginners.</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Tue, 31 Oct 2023 09:54:00 +0000</pubDate>
      <link>https://dev.to/parq254/data-engineering-for-beginners-3kn9</link>
      <guid>https://dev.to/parq254/data-engineering-for-beginners-3kn9</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;code&gt;So you want to break into data engineering? Start today by learning more about data engineering and the fundamental concepts.&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Data Engineering encompasses the set of all processes that collect and integrate raw data from various resources—into a unified and accessible data repository—that can be used for analytics and other applications.&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;What Does a Data Engineer Do?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extracting and integrating data from a variety of sources—data collection.&lt;/li&gt;
&lt;li&gt;Preparing the data for analysis: processing the data by applying suitable transformations to prepare the data for analysis and other downstream tasks. Includes cleaning, validating, and transforming data.&lt;/li&gt;
&lt;li&gt;Designing, building, and maintaining data pipelines that encompass the flow of data from source to destination. &lt;/li&gt;
&lt;li&gt;Design and maintain infrastructure for data collection, processing, and storage—infrastructure management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Engineering Concepts&lt;/strong&gt;&lt;br&gt;
we have incoming data from all resources across the spectrum: from relational databases and web scraping to news feeds and user chats. The data coming from these sources can be classified into one of the three broad categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured data-Has a well-defined schema(schema. Data in relational databases, spreadsheets, and the like)&lt;/li&gt;
&lt;li&gt;Semi-structured data-Has some structure but no rigid schema. Typically has metadata tags that provide additional information.(Include JSON and XML data, emails, zip files)&lt;/li&gt;
&lt;li&gt;Unstructured data-Lacks a well-defined schema.(Images, videos and other multimedia files, website data)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Repositories: Data Warehouses, Data Lakes, and Data Marts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we take a deep dive,we'll learn about two data processing systems, namely, OLTP and OLAP systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OLTP&lt;/strong&gt;&lt;br&gt;
or &lt;em&gt;Online Transactional Processing systems&lt;/em&gt; are used to store day-to-day operational data for applications such as inventory management. OLTP systems include relational databases that store data that can be used for analysis and deriving business insights. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OLAP&lt;/strong&gt;&lt;br&gt;
or &lt;em&gt;Online Analytical Processing systems&lt;/em&gt; are used to store large volumes of historical data for carrying out complex analytics. In addition to databases, OLAP systems also include data warehouses and data lakes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data warehouses:&lt;/strong&gt; A data warehouse refers to a single comprehensive store house of incoming data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data lakes:&lt;/strong&gt; Data lakes allow to store all data types—including semi-structured and unstructured data—in their raw format without processing them. Data lakes are often the destination for ELT processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data mart:&lt;/strong&gt;You can think of data mart as a smaller subsection of a data warehouse—tailored for a specific business use case common.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data lake houses:&lt;/strong&gt; Recently, data lake houses are also becoming popular as they allow the flexibility of data lakes while offering the structure and organization of data warehouses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Pipelines: ETL and ELT Processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data pipelines encompass the journey of data—from source to the destination systems—through ETL and ELT processes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ETL&lt;/strong&gt;—Extract, Transform, and Load—process includes the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extract data from various sources &lt;/li&gt;
&lt;li&gt;Transform the data—clean, validate, and standardize data&lt;/li&gt;
&lt;li&gt;Load the data into a data repository or a destination application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ETL processes often have a data warehouse as the destination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ELT&lt;/strong&gt;—Extract, Load, and Transform—is a variation of the ETL process where instead of extract, transform, and load, the steps are in the order: extract, load, and transform.&lt;/p&gt;

&lt;p&gt;Meaning the raw data collected from the source is loaded to the data repository—before any transformation is applied. This allows us to apply transformations specific to a particular application. ELT processes have data lakes as their destination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools Data Engineers Should Know&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds479b6rsjuqsm7tusj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds479b6rsjuqsm7tusj5.png" alt="Languages" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Programming language&lt;/strong&gt;: Intermediate to advanced proficiency in a programming language preferably one of Python, Scalar, and Java &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Databases and SQL&lt;/strong&gt;: Good understanding of database design and ability to work with databases both relational databases such as MySQL and PostgreSQL and non-relational databases such as MongoDB &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command-line fundamentals&lt;/strong&gt;: Familiarity which Shell scripting and data processing and the command line &lt;/li&gt;
&lt;li&gt;Knowledge of operating systems and networking&lt;/li&gt;
&lt;li&gt;Data warehousing fundamentals &lt;/li&gt;
&lt;li&gt;Fundamentals of distributed systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Data engineering also requires strong software engineering skills including version control, logging, and application monitoring. You should also know how you use containerization tools like Docker and container orchestration tools like Kubernetes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.getdbt.com/product/what-is-dbt/" rel="noopener noreferrer"&gt;dbt&lt;/a&gt; (data build tool) for analytics engineering&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://spark.apache.org/" rel="noopener noreferrer"&gt;Apache Spark&lt;/a&gt;for big data analysis and distributed data processing&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://airflow.apache.org/" rel="noopener noreferrer"&gt;Airflow&lt;/a&gt; for data pipeline orchestration&lt;/li&gt;
&lt;li&gt;Fundamentals of cloud computing and working with at least one cloud provider such as&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt; or &lt;a href=""&gt;Microsoft Azure&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dataengineering</category>
      <category>datascience</category>
      <category>data</category>
      <category>datanerd</category>
    </item>
    <item>
      <title>Data Engineering For Beginners.</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Tue, 31 Oct 2023 09:53:59 +0000</pubDate>
      <link>https://dev.to/parq254/data-engineering-for-beginners-57o4</link>
      <guid>https://dev.to/parq254/data-engineering-for-beginners-57o4</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;code&gt;So you want to break into data engineering? Start today by learning more about data engineering and the fundamental concepts.&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Data Engineering encompasses the set of all processes that collect and integrate raw data from various resources—into a unified and accessible data repository—that can be used for analytics and other applications.&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;What Does a Data Engineer Do?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extracting and integrating data from a variety of sources—data collection.&lt;/li&gt;
&lt;li&gt;Preparing the data for analysis: processing the data by applying suitable transformations to prepare the data for analysis and other downstream tasks. Includes cleaning, validating, and transforming data.&lt;/li&gt;
&lt;li&gt;Designing, building, and maintaining data pipelines that encompass the flow of data from source to destination. &lt;/li&gt;
&lt;li&gt;Design and maintain infrastructure for data collection, processing, and storage—infrastructure management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Engineering Concepts&lt;/strong&gt;&lt;br&gt;
we have incoming data from all resources across the spectrum: from relational databases and web scraping to news feeds and user chats. The data coming from these sources can be classified into one of the three broad categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured data-Has a well-defined schema(schema. Data in relational databases, spreadsheets, and the like)&lt;/li&gt;
&lt;li&gt;Semi-structured data-Has some structure but no rigid schema. Typically has metadata tags that provide additional information.(Include JSON and XML data, emails, zip files)&lt;/li&gt;
&lt;li&gt;Unstructured data-Lacks a well-defined schema.(Images, videos and other multimedia files, website data)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Repositories: Data Warehouses, Data Lakes, and Data Marts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we take a deep dive,we'll learn about two data processing systems, namely, OLTP and OLAP systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OLTP&lt;/strong&gt;&lt;br&gt;
or &lt;em&gt;Online Transactional Processing systems&lt;/em&gt; are used to store day-to-day operational data for applications such as inventory management. OLTP systems include relational databases that store data that can be used for analysis and deriving business insights. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OLAP&lt;/strong&gt;&lt;br&gt;
or &lt;em&gt;Online Analytical Processing systems&lt;/em&gt; are used to store large volumes of historical data for carrying out complex analytics. In addition to databases, OLAP systems also include data warehouses and data lakes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data warehouses:&lt;/strong&gt; A data warehouse refers to a single comprehensive store house of incoming data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data lakes:&lt;/strong&gt; Data lakes allow to store all data types—including semi-structured and unstructured data—in their raw format without processing them. Data lakes are often the destination for ELT processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data mart:&lt;/strong&gt;You can think of data mart as a smaller subsection of a data warehouse—tailored for a specific business use case common.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data lake houses:&lt;/strong&gt; Recently, data lake houses are also becoming popular as they allow the flexibility of data lakes while offering the structure and organization of data warehouses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Pipelines: ETL and ELT Processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data pipelines encompass the journey of data—from source to the destination systems—through ETL and ELT processes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ETL&lt;/strong&gt;—Extract, Transform, and Load—process includes the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extract data from various sources &lt;/li&gt;
&lt;li&gt;Transform the data—clean, validate, and standardize data&lt;/li&gt;
&lt;li&gt;Load the data into a data repository or a destination application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ETL processes often have a data warehouse as the destination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ELT&lt;/strong&gt;—Extract, Load, and Transform—is a variation of the ETL process where instead of extract, transform, and load, the steps are in the order: extract, load, and transform.&lt;/p&gt;

&lt;p&gt;Meaning the raw data collected from the source is loaded to the data repository—before any transformation is applied. This allows us to apply transformations specific to a particular application. ELT processes have data lakes as their destination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools Data Engineers Should Know&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds479b6rsjuqsm7tusj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds479b6rsjuqsm7tusj5.png" alt="Languages" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Programming language&lt;/strong&gt;: Intermediate to advanced proficiency in a programming language preferably one of Python, Scalar, and Java &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Databases and SQL&lt;/strong&gt;: Good understanding of database design and ability to work with databases both relational databases such as MySQL and PostgreSQL and non-relational databases such as MongoDB &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command-line fundamentals&lt;/strong&gt;: Familiarity which Shell scripting and data processing and the command line &lt;/li&gt;
&lt;li&gt;Knowledge of operating systems and networking&lt;/li&gt;
&lt;li&gt;Data warehousing fundamentals &lt;/li&gt;
&lt;li&gt;Fundamentals of distributed systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Data engineering also requires strong software engineering skills including version control, logging, and application monitoring. You should also know how you use containerization tools like Docker and container orchestration tools like Kubernetes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.getdbt.com/product/what-is-dbt/" rel="noopener noreferrer"&gt;dbt&lt;/a&gt; (data build tool) for analytics engineering&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://spark.apache.org/" rel="noopener noreferrer"&gt;Apache Spark&lt;/a&gt;for big data analysis and distributed data processing&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://airflow.apache.org/" rel="noopener noreferrer"&gt;Airflow&lt;/a&gt; for data pipeline orchestration&lt;/li&gt;
&lt;li&gt;Fundamentals of cloud computing and working with at least one cloud provider such as&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt; or &lt;a href=""&gt;Microsoft Azure&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>TIME SERIES ANALYSIS.</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Wed, 25 Oct 2023 06:34:13 +0000</pubDate>
      <link>https://dev.to/parq254/time-series-analysis-2lo4</link>
      <guid>https://dev.to/parq254/time-series-analysis-2lo4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Time Series Analysis&lt;/strong&gt; is a way of studying the characteristics of the response variable concerning time as the independent variable.&lt;br&gt;
To estimate the target variable in predicting or forecasting, use the time variable as the reference point.&lt;br&gt;
TSA represents a series of time-based orders, it would be Years, Months, Weeks, Days, Horus, Minutes, and Seconds. It is an observation from the sequence of discrete time of successive intervals.&lt;br&gt;
&lt;em&gt;Some real-world application of TSA includes weather forecasting models, stock market predictions, signal processing, and control systems.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What Is Time Series Analysis?&lt;/strong&gt;&lt;br&gt;
Time series analysis is a specific way of analyzing a sequence of data points collected over time. In TSA, analysts record data points at consistent intervals over a set period rather than just recording the data points intermittently or randomly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objectives of Time Series Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To understand how time series works and what factors affect a certain variable(s) at different points in time.&lt;/li&gt;
&lt;li&gt;Time series analysis will provide the consequences and insights of the given dataset’s features that change over time.&lt;/li&gt;
&lt;li&gt;Supporting to derive the predicting the future values of the time series variable.&lt;/li&gt;
&lt;li&gt;Assumptions: There is only one assumption in TSA, which is “stationary,” which means that the origin of time does not affect the properties of the process under the statistical factor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Analyze Time Series?&lt;/strong&gt;&lt;br&gt;
To perform the time series analysis, we have to follow the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collecting the data and cleaning it&lt;/li&gt;
&lt;li&gt;Preparing Visualization with respect to time vs key feature&lt;/li&gt;
&lt;li&gt;Observing the stationarity of the series&lt;/li&gt;
&lt;li&gt;Developing charts to understand its nature.&lt;/li&gt;
&lt;li&gt;Model building – AR, MA, ARMA and ARIMA&lt;/li&gt;
&lt;li&gt;Extracting insights from prediction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Significance of Time Series&lt;/strong&gt;&lt;br&gt;
TSA is the backbone for prediction and forecasting analysis, specific to time-based problem statements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyzing the historical dataset and its patterns&lt;/li&gt;
&lt;li&gt;Understanding and matching the current situation with patterns derived from the previous stage.&lt;/li&gt;
&lt;li&gt;Understanding the factor or factors influencing certain variable(s) in different periods.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With “&lt;em&gt;Time Series&lt;/em&gt;,” we can prepare numerous time-based analyses and results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Forecasting&lt;/strong&gt;: Predicting any value for the future.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation&lt;/strong&gt;: Grouping similar items together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classification&lt;/strong&gt;: Classifying a set of items into given classes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Descriptive analysis&lt;/strong&gt;: Analysis of a given dataset to find out what is there in it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intervention analysis&lt;/strong&gt;: Effect of changing a given variable on the outcome.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Components of Time Series Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trend&lt;/strong&gt;: In which there is no fixed interval and any divergence within the given dataset is a continuous timeline. The trend would be Negative or Positive or Null Trend&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seasonality&lt;/strong&gt;: In which regular or fixed interval shifts within the dataset in a continuous timeline. Would be bell curve or saw tooth&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cyclical&lt;/strong&gt;: In which there is no fixed interval, uncertainty in movement and its pattern&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Irregularity&lt;/strong&gt;: Unexpected situations/events/scenarios and spikes in a short time span.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What Are the Limitations of Time Series Analysis?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Similar to other models, the missing values are not supported by TSA&lt;/li&gt;
&lt;li&gt;The data points must be linear in their relationship.&lt;/li&gt;
&lt;li&gt;Data transformations are mandatory, so they are a little expensive.&lt;/li&gt;
&lt;li&gt;Models mostly work on Uni-variate data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Types of Time Series&lt;/strong&gt;&lt;br&gt;
There are two major types – stationary and non-stationary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stationary&lt;/strong&gt;: A dataset should follow the below thumb rules without having Trend, Seasonality, Cyclical, and Irregularity components of the time series.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;mean&lt;/strong&gt; value of them should be completely constant in the data during the analysis.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;variance&lt;/strong&gt; should be constant with respect to the time-frame&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Covariance&lt;/strong&gt; measures the relationship between two variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Non- Stationary&lt;/strong&gt;: If either the mean-variance or covariance is changing with respect to time, the dataset is called non-stationary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time Series Data Models.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autoregressive (AR) models&lt;/strong&gt;
AR model is a representation of a type of random process, which is why it is used for data describing time-varying processes, such as changes in weather, economics, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrated (I) models&lt;/strong&gt;
Integrated models are series with random walk components. They are called integrated because these series are the sums of weakly-stationary components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moving-average (MA) models&lt;/strong&gt;
Moving-average models are used for modeling univariate time series. In MA models, the output variable depends linearly on the current and various past values of an imperfectly predictable (stochastic) term.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These three classes in various combinations produce the following three commonly used in time series data analytics models.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autoregressive moving average (ARMA) models&lt;/strong&gt;
ARMA models combine AR and MA classes, where AR part involves regressing the variable on its own past values, while MA part is used to model the error term as a linear combination of error terms occurring contemporaneously and at various times in the past. ARMA models are frequently used for analytics and predicting future values in a series.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autoregressive integrated moving average (ARIMA) models&lt;/strong&gt;
ARIMA models are a generalization of an ARMA model and are used in cases where data show evidence of non-stationarity qualities, where an initial differencing step, corresponding to the integrated part of the model, can be applied one or more times to eliminate the non-stationarity of the mean function.
Both ARMA and ARIMA models are frequently used for analytics and predicting future values in a series.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autoregressive fractionally integrated moving average (ARFIMA) models&lt;/strong&gt;
ARFIMA model, in its turn, generalizes ARIMA models (or, basically, all the three basic classes) by allowing non-integer values of the differencing parameter. ARFIMA models are frequently used for modeling so-called long memory time series where deviations from the long-run mean decay slower than an exponential decay.
When it comes to nonlinear time series models, there are a number of models that represent changes in variability over time that are predicted by or related to recent past values of the observed series.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autoregressive conditional heteroscedasticity (ARCH) models&lt;/strong&gt;
ARCH is one such model, which describes the variance of the current error term or innovation as a function of the actual sizes of error terms.in the previous time periods.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datascience</category>
      <category>datanerd</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Exploratory Data Analysis: Data Visualization</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Sun, 08 Oct 2023 15:03:05 +0000</pubDate>
      <link>https://dev.to/parq254/exploratory-data-analysis-data-visualization-47j6</link>
      <guid>https://dev.to/parq254/exploratory-data-analysis-data-visualization-47j6</guid>
      <description>&lt;p&gt;In this article, we’ll use data visualization to explore a dataset from &lt;a href="https://github.com/Codecademy/datasets/tree/master/streeteasy" rel="noopener noreferrer"&gt;Streeteasy&lt;/a&gt; which contains information about housing rentals in New York City.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Exploratory Data Analysis (EDA)&lt;/em&gt;&lt;/strong&gt; is a process of describing the data by means of statistical and visualization techniques in order to bring important aspects of that data into focus for further analysis.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Univariate analysis&lt;/strong&gt;&lt;br&gt;
Univariate analysis focuses on a single variable at a time. Univariate data visualizations can help us answer questions like:&lt;/p&gt;

&lt;p&gt;What is the typical price of a rental in New York City?&lt;br&gt;
What proportion of NYC rentals have a gym?&lt;br&gt;
Depending on the type of variable (quantitative or categorical) we want to visualize, we need to use slightly different visualizations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quantitative variables&lt;/strong&gt;&lt;br&gt;
Box plots (or violin plots) and histograms are common choices for visually summarizing a quantitative variable. These plots are useful because they simultaneously communicate information about minimum and maximum values, central location, and spread. Histograms can additionally illuminate patterns that can impact an analysis (eg., skew or multimodality).&lt;/p&gt;

&lt;p&gt;For example, suppose we are interested in learning more about the price of apartments in NYC. A good starting place is to plot a box plot of the rent variable. We could plot a boxplot of rent as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Load libraries
import seaborn as sns
import matplotlib.pyplot as plt 

# Create the plot
sns.boxplot(x='rent', data=rentals)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n10c8oqor5it47tyjjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3n10c8oqor5it47tyjjn.png" alt="Box plot" width="576" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see that most rental prices fall within a range of $2500-$5000; however, there are many outliers, particularly on the high end. For more detail, we can also plot a histogram of the rent variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a histogram of the rent variable
sns.displot(rentals.rent, bins=10, kde=False)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2h61exnbz49lrze9vpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh2h61exnbz49lrze9vpn.png" alt="Histogram" width="382" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The histogram highlights the long right-handed tail for rental prices. We can get a more detailed look at this distribution by increasing the number of bins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a histogram of the rent variable
sns.displot(rentals.rent, bins=50, kde=False)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyusc1tahz6ui5yu1wsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjyusc1tahz6ui5yu1wsq.png" alt="Histogram" width="376" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Categorical variables&lt;/strong&gt;&lt;br&gt;
For categorical variables, we can use a bar plot (instead of a histogram) to quickly visualize the frequency (or proportion) of values in each category. For example, suppose we want to know how many apartments are available in each borough. We can visually represent that information as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a barplot of the counts in the borough variable
# The palette parameter will set the color scheme for the plot
sns.countplot(x='borough', data=rentals, palette='winter')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58rgwl5zyzkc35h3i2vq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58rgwl5zyzkc35h3i2vq.png" alt="Image" width="395" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bivariate analysis&lt;/strong&gt;&lt;br&gt;
In many cases, a data analyst is interested in the relationship between two variables in a dataset. For example:&lt;/p&gt;

&lt;p&gt;Do apartments in different boroughs tend to cost different amounts?&lt;br&gt;
What is the relationship between the area of an apartment and how much it costs?&lt;br&gt;
Depending on the types of variables we are interested in, we need to rely on different kinds of visualizations.&lt;/p&gt;

&lt;p&gt;One quantitative variable and one categorical variable&lt;br&gt;
Two good options for investigating the relationship between a quantitative variable and a categorical variable are side-by-side box plots and overlapping histograms.&lt;/p&gt;

&lt;p&gt;For example, suppose we want to understand whether apartments in different boroughs cost different amounts. We could address this question by plotting side by side box plots of rent by borough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a box plot of the borough variable relative to rent
sns.boxplot(x='borough', y='rent', data=rentals, palette='Accent')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqliy11iqpk8hmlijn4fl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqliy11iqpk8hmlijn4fl.png" alt="Image one" width="402" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This plot indicates that rental prices in Manhattan tend to be higher and have more variation than rental prices in other boroughs. We could also investigate the same question in more detail by looking at overlapping histograms of rental prices by borough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plt.hist(rentals.rent[rentals.borough=='Manhattan'], label='Manhattan', density=True, alpha=.5)
plt.hist(rentals.rent[rentals.borough=='Queens'], label='Queens', density=True, alpha=.5)
plt.hist(rentals.rent[rentals.borough=='Brooklyn'], label='Brooklyn', density=True, alpha=.5)
plt.legend()
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbkxnit6450zldhnbpr3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbkxnit6450zldhnbpr3m.png" alt="Quantitative" width="576" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two quantitative variables&lt;/strong&gt;&lt;br&gt;
A scatter plot is a great option for investigating the relationship between two quantitative variables. For example, if we want to explore the relationship between rent and size_sqft, we could create a scatter plot of these two variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a scatterplot of the size_sqft variable relative to rent
sns.scatterplot(rentals.size_sqft, rentals.rent)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnal17smdvpj8hqb6tsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnal17smdvpj8hqb6tsb.png" alt="Scatter" width="412" height="263"&gt;&lt;/a&gt;&lt;br&gt;
The plot indicates that there is a strong positive linear relationship between the cost to rent a property and its square footage. Larger properties tend to cost more money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two categorical variables&lt;/strong&gt;&lt;br&gt;
Side by side (or stacked) bar plots are useful for visualizing the relationship between two categorical variables. For example, suppose we want to know whether rentals that have an elevator are more likely to have a gym. We could plot a side by side bar plot as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.countplot(x='has_elevator', hue='has_gym', data=rentals)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57n3ixfe2v9xn4ubu1os.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57n3ixfe2v9xn4ubu1os.png" alt="Graph" width="576" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This plot tells us that buildings with elevators are approximately equally likely to have a gym or not have a gym; meanwhile, apartments without elevators are very unlikely to have a gym.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multivariate analysis&lt;/strong&gt;&lt;br&gt;
Sometimes, a data analyst is interested in simultaneously exploring the relationship between three or more variables in a single visualization. Many of the visualization methods presented up to this point can include additional variables by using visual cues such as colors, shapes, and patterns. For example, we can investigate the relationship between rental price, square footage, and borough by using color to introduce our third variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sns.scatterplot(rentals.size_sqft, rentals.rent, hue = rentals.borough, palette='bright')
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphhg5wgtp4cqm5s92zye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphhg5wgtp4cqm5s92zye.png" alt="Scatter" width="576" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another common data visualization for multivariate analysis is a heat map of a correlation matrix for all quantitative variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Define the colormap which maps the data values to the color space defined with the diverging_palette method  
colors = sns.diverging_palette(150, 275, s=80, l=55, n=9, as_cmap=True)

# Create heatmap using the .corr method on df, set colormap to cmap
sns.heatmap(rentals.corr(), center=0, cmap=colors, robust=True)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xx8z2bk5rugwbvkf10w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xx8z2bk5rugwbvkf10w.png" alt="Heat Map" width="477" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
In this article, I’ve summarized some of the important considerations for choosing a data visualization based on the question a data analyst wants to answer and the type of data that is available. &lt;/p&gt;

</description>
      <category>datascience</category>
      <category>datanerd</category>
      <category>visualization</category>
    </item>
    <item>
      <title>Between linear regression and random forest regression, which model would perform better and why?</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Sun, 08 Oct 2023 13:36:55 +0000</pubDate>
      <link>https://dev.to/parq254/between-linear-regression-and-random-forest-regression-which-model-would-perform-better-and-why-3kh2</link>
      <guid>https://dev.to/parq254/between-linear-regression-and-random-forest-regression-which-model-would-perform-better-and-why-3kh2</guid>
      <description>&lt;p&gt;Let's look at the two in deapth to better understand which of the two works better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Random forest regression&lt;/em&gt;&lt;/strong&gt; is based on the ensemble machine learning technique of bagging. The two key concepts of random forests are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random sampling of training observations when building trees.&lt;/li&gt;
&lt;li&gt;Random subsets of features for splitting nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Random forest regressions also discretize continuous variables since they are based on decision trees, which function through recursive binary partitioning at the nodes. This effectively means that we can split not only categorical variables, but also split continuous variables. Additionally, with enough data and sufficient splits, a step function with many small steps can approximate a smooth function for predicting an output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Linear regression&lt;/em&gt;&lt;/strong&gt; on the other hand is the standard regression technique in which relationships are modeled using a linear predictor function, the most common example of &lt;strong&gt;y = Ax + B&lt;/strong&gt;. Linear regression models are often fitted using the least-squares approach.&lt;/p&gt;

&lt;p&gt;There are also four main assumptions in linear regression:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A normal distribution of error terms&lt;/li&gt;
&lt;li&gt;Independence in the predictors&lt;/li&gt;
&lt;li&gt;The mean residuals must equal zero with constant variance&lt;/li&gt;
&lt;li&gt;No correlation between the features
So how do we differentiate between random forest regression and linear regression independent of the problem statement?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference between random forest regression versus standard regression techniques for many applications are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random forest regression can approximate complex nonlinear shapes without a prior specification. Linear regression performs better when the underlying function is linear and has many continuous predictors.&lt;/li&gt;
&lt;li&gt;Random forest regression allows the use of arbitrarily many predictors (more predictors than data points is possible)&lt;/li&gt;
&lt;li&gt;Random forest regression can also capture complex interactions between predictions without a prior specification&lt;/li&gt;
&lt;li&gt;Both will give some semblance of a “feature importance.
linear regression feature importance is much more interpretable than random forest given the linear regression coefficient values attached to each predictor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion.&lt;/strong&gt;&lt;br&gt;
Random Forest tends to perform better than Linear Regression when: The data has a large number of features. The data has complex, non-linear relationships. The data contains missing values or outliers&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Science Roadmap.</title>
      <dc:creator>Christopher Ambala</dc:creator>
      <pubDate>Fri, 29 Sep 2023 13:41:23 +0000</pubDate>
      <link>https://dev.to/parq254/data-science-roadmap-1glg</link>
      <guid>https://dev.to/parq254/data-science-roadmap-1glg</guid>
      <description>&lt;p&gt;Every organization has data stored in their service about their customers. They need to take advantage of this data to improve their service, better manage their marketing campaigns, but this is possible only by data scientists since they have the skills in math, programming, statistics to organize this extensive data and apply their knowledge to find hidden solutions in this data. &lt;/p&gt;

&lt;p&gt;This article will show you the resources you need to learn to become a data scientist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Learn Python Language&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This journey starts with learning this fabulous programming language called python which almost every person who works as a data scientist should understand very well. This language is used a lot when working with data, such as collecting data from resources such as web scraping or the database. You will also need to visualize them and create a machine learning model for prediction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Data Processing &amp;amp; Visualization&lt;/strong&gt;&lt;br&gt;
You can define data visualization as the process of converting your dataset after cleaning it into charts that have meaning and can drive decisions for offering better services, better user experience, understanding more about your customers, and the list is endless. There are a lot of data processing and visualization libraries that work with python, and let’s first explore two of the best data processing libraries:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.1. Numpy&lt;/strong&gt;&lt;br&gt;
This is a python library developed to work with arrays. Numpy can use it for mathematical calculation, which is very important for knowing if you are a data scientist. It's also one of the essential Python library every Machine Learning Engineer and Data Scientis should learn. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2. Pandas&lt;/strong&gt;&lt;br&gt;
This is used for working with tabular data such as CSV files, importing your data from different resources, and it is used a lot for data analysis and cleaning your data before using it.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.3. Matplotlib&lt;/strong&gt;&lt;br&gt;
This is the most common and used python library for data visualization. It can create some fantastic graphs and charts with simple programming commands. It supports 3D visualizing, which makes it perfect for this purpose. Data Scientist and ML Engineer you should learn Matplotlib in 2023 along with NumPy and Pandas. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.4. Tableau&lt;/strong&gt; &lt;br&gt;
Tableau is a data visualization tool that doesn’t need any programming skills to use, and it is used a lot in the business intelligence industry. Non-technical people can use it for making customized dashboards. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.5. Power BI&lt;/strong&gt;&lt;br&gt;
Microsoft Power BI is a cloud-based data analytic and visualization service with a more incredible speed and efficiency offered by Microsoft. Many versions also work on the phone and desktop.&lt;/p&gt;

&lt;p&gt;These are the best libraries and tools used among data scientists in their daily routine, but you explore more others if you want, such as Plotly and leaflet. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Learn Math&lt;/strong&gt;&lt;br&gt;
You don’t need to have excellent skills in math to be a data scientist. Still, it would be best to have a basic understanding of math, such as linear algebra, calculus, probabilities, and statistics. &lt;/p&gt;

&lt;p&gt;These skills will be beneficial when working with data, such as transforming it into another shape or performing operations using a numpy library. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Machine Learning&lt;/strong&gt;&lt;br&gt;
Machine learning can be very useful if you want to become a data scientist since it will help you make predictions and it can make the machine take the right decisions without any human intervention. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1. Tensorflow&lt;/strong&gt;&lt;br&gt;
This is an open-source artificial intelligence library developed by Google and used a lot in deep learning models where you need to analyze a large amount of data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.2. Scikit-Learn&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the most used library among machine learning engineers and data scientists, which can be very useful in a small amount of data and easy to use compared to Tensorflow. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
This is an overview of the data science roadmap. You can learn more about programming languages used among data scientists such as R language, and deep dive into more about machine learning &amp;amp; deep learning.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>datascience</category>
      <category>datanerd</category>
      <category>bigdata</category>
    </item>
  </channel>
</rss>
