<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by satvinderinghmaviDataScience on Medium]]></title>
        <description><![CDATA[Stories by satvinderinghmaviDataScience on Medium]]></description>
        <link>https://medium.com/@imsatvindersinghmavi?source=rss-87ca4eff25fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zKcF36e1A1BDtl668SIp0g.jpeg</url>
            <title>Stories by satvinderinghmaviDataScience on Medium</title>
            <link>https://medium.com/@imsatvindersinghmavi?source=rss-87ca4eff25fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:01:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imsatvindersinghmavi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Type Casting or Type Coersion #PythonForDataScience-06]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/type-casting-or-type-coersion-pythonfordatascience-06-cb6d12df676d?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb6d12df676d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 14:50:16 GMT</pubDate>
            <atom:updated>2025-12-15T14:50:16.443Z</atom:updated>
            <content:encoded><![CDATA[<p>Type Casting in Python means converting one data type into another data type.</p><p><strong>Types of Type Casting in Python:</strong></p><ol><li>Implicit Type Casting (Automatically by Python)</li></ol><pre>x = 10      # int<br>y = 3.5     # float<br>z = x + y   # result becomes float<br>print(z)     # 13.5</pre><p>2. Explicit Type Casting (Manually by the programmer)</p><p>int() float() str() bool() complex()</p><p><strong>To convert any type value to int:</strong></p><pre>print((int(45.56)) #45 Decimal part is truncated, not rounded.<br><br>print(int(10+20j)) #TypeError: int() argument must be a string, a bytes-like object or a real number, not &#39;complex&#39;<br><br>print(int(False))  #0<br><br>print(int(&quot;20&quot;))   #20 ,only decimal format integer value  is acceptable that too , if String contains: no commas , no spaces , no decimals , no characters <br><br>print(int(&quot;20.4&quot;)) #ValueError: invalid literal for int() with base 10: &#39;20.4&#39;<br><br>print(int(&quot;0B111&quot;)) #ValueError: invalid literal for int() with base 10: &#39;0B111&#39;<br></pre><p><strong>Note:</strong> A string must represent a valid integer in decimal form only if you want to convert it to the int data type explicitly using int().</p><p><strong>To convert from any type value to float():</strong></p><pre>print(float(30))        #30.0<br>print(float(10 + 20j))  #TypeError: float() argument must be a string or a real number, not &#39;complex&#39;<br>print(float(True))      #1.0<br>print(float(&quot;10&quot;))      #10.0<br>print(float(&quot;10.5&quot;))    #10.5<br>print(float(&quot;Ten&quot;))     #ValueError: could not convert string to float: &#39;Ten&#39;  <br>pritn(float(&quot;0b1111&quot;))  #ValueError: could not convert string to float: &#39;0b1111&#39;</pre><p><strong>Note: </strong>float() accepts integers(decimal form), booleans, and strings that contain valid numeric values (integer or decimal). Complex numbers and invalid strings cannot be converted.</p><p><strong>To convert from any type value to Complex:</strong></p><pre>complex(10.5)    #(10.5+0j)<br>complex(10)      #(10+0j)<br>complex(True)    #(1+0j)<br>complex(False)   #0j<br><br>complex(&quot;10&quot;)    #(10+0j)<br>complex(&quot;10.5&quot;)  #(10.5+0j)<br>commplex(&quot;ten&quot;)  #ValueError: complex() arg is a malformed string<br></pre><p><strong>To convert from any type value to bool:</strong></p><pre>print(bool(30))          # True<br>print(bool(0))           # False<br><br>print(bool(10 + 20j))    # True<br>print(bool(20j))         # True<br>print(bool(0 + 0j))      # False<br><br>print(bool(1.5))         # True<br>print(bool(0.0))         # False<br><br>print(bool(True))        # True<br>print(bool(False))       # False<br><br>print(bool(&quot;Hello&quot;))     # True<br>print(bool(&quot;&quot;))          # False<br><br>print(bool(&quot;0b1111&quot;))    # True   (non-empty string → True)<br>print(bool(&quot;0&quot;))         # True   (string &quot;0&quot; is NOT zero → True)<br><br>print(bool([]))          # False<br>print(bool([1, 2, 3]))   # True<br><br>print(bool(None))        # False</pre><p><strong>Note:</strong> A value converts to bool based on truthiness. Only zero values, empty collections, empty strings, None , and False become False. All other values become True.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eBX-x1grZAdXtF1_msF8A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb6d12df676d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Data Science]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/what-is-data-science-c9405e42a71a?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9405e42a71a</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 14:49:45 GMT</pubDate>
            <atom:updated>2025-12-15T14:49:45.063Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Data Science ?</p><p>-&gt;Data Science is the study of the data.</p><p>-&gt;Its the process of understanding the world , with the help of the data.</p><p>-&gt;Data science is the field of exploring, manipulating, and analyzing data, and using data to answer questions or make recommendations.</p><p>-&gt;Data Science is the art of uncovering the hidden insights of the data.</p><p>For Example:</p><p>*Companies use customer clicks and purchase history to understand what people actually like — just like how Netflix studies your watch patterns to recommend shows.</p><p>*Banks analyse thousands of transactions to detect unusual patterns and catch fraud.</p><p>*Doctors and hospitals analyse patient records to understand which treatments work best for certain diseases.</p><p>*Online Food ordereing Applications uses data to decide delivery times, recommend food items, and even predict when you’re likely to order again.</p><p>#DataScience #data #science #educational #technology</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9405e42a71a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Types In Python(Fundamental) #PythonForDataScience-05]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/data-types-in-python-fundamental-pythonfordatascience-05-527f5088b5b3?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/527f5088b5b3</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 19:58:18 GMT</pubDate>
            <atom:updated>2025-11-28T19:58:18.321Z</atom:updated>
            <content:encoded><![CDATA[<p>Python is a dynamically typed programming language, which means there is no need to write the data type before the variable name. At run time, the Python interpreter automatically identifies the type of data assigned to any variable.</p><p>Python provides several built-in data types such as <strong>int, float, complex, boolean, string, bytes, bytearray, range, list, tuple, dictionary, set, frozenset,</strong> and <strong>None</strong>.</p><p><strong>Note:</strong> In Python, everything is an object — whether it is a number, string, list, tuple, or even functions and classes themselves. Every value in Python is an instance of some class</p><p>Let us discuss each of them one by one.</p><p>1.<strong>int data type</strong></p><p>The int data type in Python is used to represent integer values, meaning whole numbers without a decimal point. Python allows integers to be written in multiple number systems:</p><p><strong>Decimal (base 10)</strong> — By default Python assigns whole numberss without a decimal point in the decimal form.</p><p><strong>Binary (base 2) </strong>— Prefixed with 0B or 0b</p><p><strong>Octal (base 8)</strong> — Prefixed with 0o or 0O</p><p><strong>Hexadecimal (base 16)</strong> — Prefixed with 0X or 0x</p><pre>num_decimal = 25<br>print(num_decimal) # 25<br>print(type(num_decimal)) # &lt;class &#39;int&#39;&gt;<br><br>num_binary = 0b1101<br>print(num_binary) # 13<br>print(type(num_binary)) # &lt;class &#39;int&#39;&gt;<br><br>num_octal = 0o37<br>print(num_octal) #31<br>print( type(num_octal)) # &lt;class &#39;int&#39;&gt;<br><br>num_hex = 0x1A<br>print(num_hex) # 26 <br>print(type(num_hex)) #&lt;class &#39;int&#39;&gt;<br></pre><p><strong>Base conversions are also possible:</strong></p><pre># Original decimal number<br>num = 10  <br><br># Convert to other bases<br>binary_val = bin(num)      # &#39;0b1010&#39;<br>octal_val = oct(num)       # &#39;0o12&#39;<br>hex_val = hex(num)         # &#39;0xa&#39;<br><br>print(binary_val)<br>print(octal_val)<br>print(hex_val)<br><br># Convert back to integer using int(value, base)<br>print(int(binary_val, 2))  # 10<br>print(int(octal_val, 8))   # 10<br>print(int(hex_val, 16))    # 10</pre><p><strong>2. Float data type</strong></p><p>Only decimal represention(base 10) is allowed.</p><p>For example:</p><pre>salary = 34500.45;<br>print(salary); #34500.45<br>print(type(salary)) #&lt;class &#39;float&#39;&gt;<br>balance = 45678.67;<br>print(balance); #45678.67<br>print(type(balance));#&lt;class &#39;float&#39;&gt;</pre><p>Floating point numbers can also be represented in the exponentiel form.</p><pre>amount = 10e3<br>print(amount) #10000.0<br>print(type(amount)) #&lt;class &#39;float&#39;&gt;</pre><p><strong>3.Complex Data Type</strong></p><p>A complex number in Python is represented in the form: <strong>a + bj</strong></p><p><strong>Where:</strong><br><strong>a</strong> = real part<br><strong>b</strong> = imaginary part</p><pre>y = 2 + 3j<br>print(type(y)) #&lt;class &#39;complex&#39;&gt;<br><br>x = 2.5 + 4.5j<br>print(type(x)) #&lt;class &#39;complex&#39;&gt;</pre><p><strong>Note:</strong></p><ol><li>Both int and float can be used as the real part and the imaginary part.</li><li>The real part can be written in any number system: decimal, binary, octal, or hexadecimal.</li><li>The imaginary part must always be in decimal form (Python does not allow binary, octal, or hexadecimal for the imaginary part).</li></ol><p><strong>4.Bool data type</strong></p><p>The <strong>bool</strong> data type in Python allows only two values: <strong>True</strong> and <strong>False</strong>.</p><p><strong>True</strong> is internally treated as <strong>1</strong></p><p><strong>False</strong> is internally treated as <strong>0</strong></p><pre>print(True + True)     # Output: 2<br>print(False + True)    # Output: 1<br><br>x = True<br>print(x)               # Output: True<br><br>y = int(x)<br>print(y)               # Output: 1</pre><p>In Python, True and False are actually objects of the bool class, which is a subclass of int. That’s why they behave like numbers in arithmetic operations.</p><pre>print(type(True)) #&lt;class &#39;bool&#39;&gt;<br><br>print(type(False)) #&lt;class &#39;bool&#39;&gt;<br><br>print(issubclass(bool, int)) #True<br></pre><p>In Python, any non-zero number is treated as True when converted to a boolean using bool().</p><pre>x = -45<br>y = bool(x)<br>print(y) #True<br></pre><p><strong>5.String data type</strong></p><p>A string in Python is a sequence of characters enclosed within single quotes (‘…’), double quotes (‘‘ … ’’), or triple quotes ‘‘‘ … ’’’).</p><pre>print(&#39;Hello&#39;)<br>print(&quot;World&quot;)<br>print(&quot;&quot;&quot;&quot;This is a <br>      multiline string &quot;&quot;&quot;)<br><br>print(&quot;&#39;My name is Satvinder Singh&#39;&quot;) <br><br>output:<br><br>Hello<br>World<br>&quot;This is a <br>      multiline string <br>&#39;My name is Satvinder Singh&#39;<br><br></pre><p><strong>Note: </strong>Python <strong>does not</strong> have a special <strong>char</strong> (character) data type.</p><p>A single character is treated as a <strong>string of length 1</strong>.</p><pre>x = &#39;A&#39;          # This is a string, not a char<br>print(type(x))   # &lt;class &#39;str&#39;&gt;<br>print(len(x))    # 1<br> </pre><p><strong>Note: <br></strong>In Python 2, there were two integer types:<br>int (limited range) and long (unlimited range).<br>In Python 3, int <strong>was upgraded</strong> to support <strong>arbitrary precision</strong>, so:<br>-&gt;long no longer exists<br>-&gt;All integers are simply int, regardless of size</p><pre>x = 999999999999999999999999999999<br>print(type(x))   # &lt;class &#39;int&#39;&gt;</pre><p><strong>Note:<br> </strong><br>Python is dynamically typed.<br>You don’t need to declare data types manually.<br>Python figures out the type at runtime.</p><pre>x = 10 # int <br>x = &quot;Hi&quot; # now str</pre><p><strong>Slicing in Python:</strong></p><p>x = ‘satvinder’</p><p><strong>Note:</strong> A string literal is a sequence of characters.</p><p><strong>As per the positive indexing :</strong></p><p>x[0] = s , x[1] = a , x[2] = t , x[3] = v , x[4] = i , x[5] = n , x[6] = d , x[7] = e and</p><p>x[8] = r</p><p><strong>As per the negative indexing :</strong></p><p>x[-9] = s , x[-8] = a , x[-7] = t , x[-6] = v , x[-5] = i , x[-4] = n , x[-3] = d , x[-2] = e and x[-1] = r</p><p><strong>Syntax for slicing :</strong></p><p>string[start : stop : step]</p><p><strong>start</strong> → slicing begins from this index (included)<br><strong>stop</strong> → slicing ends at this index (excluded)<br><strong>step</strong> → jump / gap between characters (default = 1)</p><pre>s = &quot;Python&quot;<br><br>s[0] = P ,  s[1] = y , s[2] = t , s[3] = h , s[4] = o , s[5] = n<br><br>print(s[0:3])   #Pyt<br><br>print(s[ : 4])  #Pyth<br><br>print(s[2 : ])  #thon<br><br>print(s[0:6:2]) #Pto<br><br>print(s[-6:-3]) #Pyt<br><br>print(s[4:2])   # start=4, stop=2, step=+1 (default) <br><br>output: &#39;&#39;   # empty string<br><br>print(s[-2:-5])    # start=-2 (o), stop=-5 (y), step=+1<br><br>output: &#39;&#39;   # empty string<br><br>print(s[1:5:-1])   # start=1 (y), stop=5 (n), step=-1<br><br>output: &#39;&#39;   # empty string<br><br>print(s[::0])<br><br>ValueError: slice step cannot be zero<br><br>print(s[10])      # IndexError: string index out of range<br><br>print(s[10:20])   # slice out of range <br><br>Output: &#39;&#39;   # empty string, NO error</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3oOFmPSyNbSKNDC55vIwA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=527f5088b5b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reserved Words and Data Types in Python #PythonForDataScience-04]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/reserved-words-and-data-types-in-python-pythonfordatascience-04-35ac013f4f03?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/35ac013f4f03</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 16:45:41 GMT</pubDate>
            <atom:updated>2025-11-25T16:45:41.306Z</atom:updated>
            <content:encoded><![CDATA[<p>When we learn any programming language , the very first thing that we come across is reserved words. These are the special words that represent some special meanings and functionalities.</p><p><strong>Que :</strong> How many reserved words are there in Python ?</p><p><strong>Ans :</strong> As per python 3.x version , there are 35 reserved words (keywords) in Python.</p><p><strong>Note :</strong></p><p><strong>=&gt;</strong> Each Keyword is tied to some specific operation or syntax rule in python .</p><p><strong>=&gt;</strong> All the keywords are wriiten using the english language letters. Except for True , False and None all other keywords are written in lower case.</p><p><strong>Following is the list of the Python Keywords :</strong></p><pre>import keyword <br>keyword.kwlist<br>#Output <br>[&#39;False&#39;,&#39;None&#39;,&#39;True&#39;,&#39;and&#39;,&#39;as&#39;,&#39;assert&#39;,&#39;async&#39;,&#39;await&#39;,&#39;break&#39;,&#39;class&#39;,<br>&#39;continue&#39;,&#39;def&#39;,&#39;del&#39;,&#39;elif&#39;,&#39;else&#39;,&#39;except&#39;,&#39;finally&#39;,&#39;for&#39;,&#39;from&#39;,&#39;global&#39;,<br>&#39;if&#39;,&#39;import&#39;,&#39;in&#39;,&#39;is&#39;,&#39;lambda&#39;,&#39;nonlocal&#39;,&#39;not&#39;,&#39;or&#39;,&#39;pass&#39;,&#39;raise&#39;,&#39;return&#39;,<br>&#39;try&#39;,&#39;while&#39;,&#39;with&#39;,&#39;yield&#39;]</pre><p><strong>Note: Before 3.5 version , there were 33 keywords and from Python 3.5 onwards two new keywords were added.</strong></p><p><strong>DATA TYPES IN PYTHON</strong></p><p>What is Data Type ?<br>Data types specify what kind of data is assigned to a variable. Every value has a specific type such as boolean, numeric, etc.</p><p>Python is dynamically typed , hence there is no need to declare the type of the variable when creating it. The Python interpreter automatically detects it.</p><p><strong>For Example :</strong></p><pre>x = 100        # Interpreter decides → int <br>y = 3.14       # Interpreter decides → float<br>z = &quot;Hello&quot;    # Interpreter decides → str</pre><p>Python provides 15 built-in data types , categorized as follows :</p><p><strong>a. Numeric Data Types</strong></p><p>-&gt; int, float and complex</p><p><strong>For Example :</strong></p><pre># Integer<br><br>student_age = 25<br>print(&quot;Integer Value:&quot;, student_age)<br>print(&quot;Type:&quot;, type(student_age))<br>print(&quot;ID (Memory Address):&quot;, id(student_age))<br>print()<br><br>####### output : <br><br>Integer Value: 25<br>Type: &lt;class &#39;int&#39;&gt;<br>ID (Memory Address): 11642856<br><br># Float<br><br>num_float = 25.75<br>print(&quot;Float Value:&quot;, num_float)<br>print(&quot;Type:&quot;, type(num_float))<br>print(&quot;ID (Memory Address):&quot;, id(num_float))<br>print()<br><br>####### output :<br><br>Float Value: 25.75<br>Type: &lt;class &#39;float&#39;&gt;<br>ID (Memory Address): 135890484902128<br><br># Complex<br><br>num_complex = 3 + 5j<br>print(&quot;Complex Value:&quot;, num_complex)<br>print(&quot;Type:&quot;, type(num_complex))<br>print(&quot;ID (Memory Address):&quot;, id(num_complex))<br><br>####### output :<br><br>Complex Value: (3+5j)<br>Type: &lt;class &#39;complex&#39;&gt;<br>ID (Memory Address): 135890005565360</pre><p><strong>b. Sequence Types</strong></p><p>-&gt; str , list tuple and range</p><p><strong>For Example :</strong></p><pre># String<br><br>student_name = &quot;satvindersinghmavi&quot;<br>print(&quot;String Value:&quot;, student_name)<br>print(&quot;Type:&quot;, type(student_name))<br>print(&quot;ID (Memory Address):&quot;, id(student_name))<br>print()<br><br>####### output :<br><br>String Value: satvindersinghmavi<br>Type: &lt;class &#39;str&#39;&gt;<br>ID (Memory Address): 2564933729776<br><br># List<br><br>student_marks = [85, 90, 78]<br>print(&quot;List Value:&quot;, student_marks)<br>print(&quot;Type:&quot;, type(student_marks))<br>print(&quot;ID (Memory Address):&quot;, id(student_marks))<br>print()<br><br>####### output :<br><br>List Value: [85, 90, 78]<br>Type: &lt;class &#39;list&#39;&gt;<br>ID (Memory Address): 135890003689216<br><br># Tuple<br><br>student_subjects = (&quot;Math&quot;, &quot;Science&quot;, &quot;English&quot;)<br>print(&quot;Tuple Value:&quot;, student_subjects)<br>print(&quot;Type:&quot;, type(student_subjects))<br>print(&quot;ID (Memory Address):&quot;, id(student_subjects))<br>print()<br><br>####### output :<br><br>Tuple Value: (&#39;Math&#39;, &#39;Science&#39;, &#39;English&#39;)<br>Type: &lt;class &#39;tuple&#39;&gt;<br>ID (Memory Address): 135890006479808<br><br># Range<br><br>numbers = range(1, 6)  # will generate numbers 1 to 5<br>print(&quot;Range Value:&quot;, list(numbers))  # converting to list for better display<br>print(&quot;Type:&quot;, type(numbers))<br>print(&quot;ID (Memory Address):&quot;, id(numbers))<br><br>####### output :<br><br>Range Value: [1, 2, 3, 4, 5]<br>Type: &lt;class &#39;range&#39;&gt;<br>ID (Memory Address): 135890007066208</pre><p><strong>c. Set Types</strong></p><p>-&gt; set and frozenset</p><p><strong>For Example :</strong></p><pre># Set<br><br>unique_numbers = {1, 2, 3, 4, 2, 3}   # duplicates will be removed automatically<br>print(&quot;Set Value:&quot;, unique_numbers)<br>print(&quot;Type:&quot;, type(unique_numbers))<br>print(&quot;ID (Memory Address):&quot;, id(unique_numbers))<br>print()<br><br>####### output :<br><br>Set Value: {1, 2, 3, 4}<br>Type: &lt;class &#39;set&#39;&gt;<br>ID (Memory Address): 281473123456<br><br># Frozenset<br><br>frozen_numbers = frozenset([1, 2, 3, 4, 2, 3])<br>print(&quot;Frozenset Value:&quot;, frozen_numbers)<br>print(&quot;Type:&quot;, type(frozen_numbers))<br>print(&quot;ID (Memory Address):&quot;, id(frozen_numbers))<br><br>####### output :<br><br>Frozenset Value: frozenset({1, 2, 3, 4})<br>Type: &lt;class &#39;frozenset&#39;&gt;<br>ID (Memory Address): 281473789012</pre><p><strong>Note : Set is Mutable and frozenset is immutable.</strong></p><p><strong>d. Mapping Type</strong></p><p>-&gt; dict</p><p><strong>For Example :</strong></p><pre># Dictionary<br><br>student = {<br>    &quot;name&quot;: &quot;Satvinder&quot;,<br>    &quot;age&quot;: 25,<br>    &quot;subjects&quot;: [&quot;Math&quot;, &quot;Science&quot;, &quot;English&quot;]<br>}<br><br>print(&quot;Dictionary Value:&quot;, student)<br>print(&quot;Type:&quot;, type(student))<br>print(&quot;ID (Memory Address):&quot;, id(student))<br><br>####### output :<br><br>Dictionary Value: {&#39;name&#39;: &#39;Satvinder&#39;, &#39;age&#39;: 25, &#39;subjects&#39;: [&#39;Math&#39;, &#39;Science&#39;, &#39;English&#39;]}<br>Type: &lt;class &#39;dict&#39;&gt;<br>ID (Memory Address): 281473994576</pre><p><strong>e. Boolean Type</strong></p><p>-&gt; bool</p><p><strong>For Example :</strong></p><pre># Boolean value<br><br>is_graduated = False<br>print(&quot;Boolean Value (is_graduated):&quot;, is_graduated)<br>print(&quot;Type:&quot;, type(is_graduated))<br>print(&quot;ID (Memory Address):&quot;, id(is_graduated))<br><br>####### output :<br><br>Boolean Value (is_graduated): False<br>Type: &lt;class &#39;bool&#39;&gt;<br>ID (Memory Address): 140715341417008</pre><p><strong>f. Binary Type</strong></p><p>-&gt; bytes , bytearray and memoryview</p><p><strong>For Example :</strong></p><pre># bytes<br><br>b = bytes([65, 66, 67, 68])  # ASCII values for A, B, C, D<br>print(&quot;Bytes Value:&quot;, b)<br>print(&quot;Type:&quot;, type(b))<br>print(&quot;ID (Memory Address):&quot;, id(b))<br>print()<br><br>####### output :<br><br>Bytes Value: b&#39;ABCD&#39;<br>Type: &lt;class &#39;bytes&#39;&gt;<br>ID (Memory Address): 135890490171792<br><br># bytearray<br><br>ba = bytearray([65, 66, 67, 68])<br>print(&quot;Bytearray Value:&quot;, ba)<br>print(&quot;Type:&quot;, type(ba))<br>print(&quot;ID (Memory Address):&quot;, id(ba))<br>print()<br><br>####### output :<br><br>Bytearray Value: bytearray(b&#39;ABCD&#39;)<br>Type: &lt;class &#39;bytearray&#39;&gt;<br>ID (Memory Address): 135890010263344<br><br># memoryview<br><br>mv = memoryview(b)<br>print(&quot;Memoryview Value:&quot;, mv)<br>print(&quot;Type:&quot;, type(mv))<br>print(&quot;ID (Memory Address):&quot;, id(mv))<br>print(&quot;Accessing memoryview content:&quot;, mv[0], mv[1], mv[2], mv[3])<br>  # shows numeric values<br><br><br>####### output :<br><br>Memoryview Value: &lt;memory at 0x7b977cc40640&gt;<br>Type: &lt;class &#39;memoryview&#39;&gt;<br>ID (Memory Address): 135890563499584<br>Accessing memoryview content: 65 66 67 68</pre><p><strong>g. None Type</strong></p><p>-&gt; None</p><pre>n = None<br>print(&quot;Value:&quot;, n)<br>print(&quot;Type:&quot;, type(n))<br>print(&quot;ID (Memory Address):&quot;, id(n)) <br><br>####### output : <br><br>Value: None<br>Type: &lt;class &#39;NoneType&#39;&gt;<br>ID (Memory Address): 140736496844784</pre><pre><strong>Note : In Python everything is an object internally , and every object has sa type.</strong></pre><p><strong>Python provides several built-in functions, such as:</strong></p><ul><li><strong>type() : </strong>to get the type of the object</li><li><strong>id() :</strong> to get the address of the object</li><li><strong>print() :</strong> to display message or value</li><li>etc…</li></ul><pre>student_age = 25<br>print(student_age)        # we can print the value or any message <br>print(type(student_age))  # we can get the type of the object <br>print(id(student_age))    # we can get the address of the object<br><br>######### Output <br><br>25<br>&lt;class &#39;int&#39;&gt; #It indicates that student_age is an object of class int <br>11642856</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuT9skcXW3r6EnC_hpRL4g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35ac013f4f03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flavors ,Versions ,Identifiers , and Conventions in Python #PythonForDataScience-03]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/flavors-versions-identifiers-and-conventions-in-python-pythonfordatascience-03-c263a643660a?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c263a643660a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 16:45:13 GMT</pubDate>
            <atom:updated>2025-11-25T16:45:13.958Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flavors ,Versions ,Identifiers , and Conventions in Python #PythonForDataScience-03</h3><p><strong>FLAVORS OF PYTHON</strong></p><p>When we often talk about the python , we simply think of the python versions which we we download from the python.org , However Python has certain flavors of it , or we can say that it has certain implementations of it.</p><p>Following are discussed as the different implementations (flavors) of the python :</p><p><strong>1. CPython</strong></p><p>It is the default implementation and the mostly used flavor of the python.When we install python from its official website we are actually using the default Cpython itself.</p><p>Note : Its the standard flavor of python and it can also be used to work with ‘C’ programming language.</p><p><strong>2. Jython (JPython)</strong></p><p>It is useful if we are working with the Java Ecosystem and we want some python programming over there.</p><p><strong>3. IronPython</strong></p><p>It is useful in case of C# .net environment.</p><p><strong>4. Pypy</strong></p><p>If relatively we want to enhance the performance then we can use it.<br>It comes with the JIT compiler , which makes it performance wise good as compare to the traditional python.</p><p><strong>5. Stackless Python</strong></p><p>It is designed for the concurrency. Hence it s used in case of the gaming applications.</p><p><strong>Note: Anaconda Python is not a separate flavor of python , its a python distribution based on Cpython coming along with the pre-packaged data science libraries , hence we can think of it as “CPython + libraries” .</strong></p><p><strong>VERSIONS OF PYTHON</strong></p><p>There are three versions of the python till date(31–08–2025)</p><p><strong>Python 1.x </strong>: Laid the foundation for todays python.</p><p><strong>Python 2.x :</strong> Official Support ended in 2020.</p><p><strong>Python 3.x : </strong>Actively Update and widely used today.</p><p><strong>Note : Python 3.13 (2024) </strong>is currently the latest stable version which emphasize on the cleanup and performance.</p><p><strong>IDENTIFIERS IN PYTHON</strong></p><p>In any of the programming languages , identifiers are nothing but are those ,by the help of which we can identify.<br>It is the name given to any programming element such as variable , class , function or method.</p><p>For Example :</p><pre>name = &quot;satvindersinghmavi&quot;     # variable<br>def greet():           # function<br>    print(&quot;Welcome to satvindersinghmavi medium stories&quot;)<br>class Student:         # class<br>    pass</pre><p><strong>Following are discussed as the rules for naming identifiers in python :</strong></p><ul><li>The allowed characters in the python includes alphabets (A-Z and a-z) and digits (0–9) , hence we can conclude that both uppercase and the lowercase letters are allowed.</li><li>Out of special characters only underscore (_) is allowed.</li><li>Unlike Java dollar ($) symbol is not allowed.</li></ul><p>For Example :</p><pre>public class A {<br>   <br>    public static void main (String[] satvindersinghmavi){<br>     String $name = &quot;satvindersinghmavi&quot; ;<br>     System.out.println($name); // satvindersinghmavi<br>    }<br> <br>}</pre><pre>$name = &quot;satvindersinghmavi&quot;<br>#SyntaxError: invalid syntax</pre><p>. An identifier cannot begin with a digit .</p><p>For Example :</p><pre>1name = &quot;satvindersinghmavi&quot;<br>#SyntaxError: invalid decimal literal</pre><ul><li>Python is case sensitive.</li></ul><p>For Example :</p><pre>name = &quot;satvindersinghmavi&quot;<br>NAME = &quot;SATVINDERSINGHMAVI&quot;<br>Name = &quot;SatvinderSinghMavi&quot;<br><br>print(name) #satvindersinghmavi<br>print(NAME) #SATVINDERSINGHMAVI<br>print(Name) #SatvinderSinghMavi</pre><p>. Reserved words are not allowed as identifiers.</p><p>For Example :</p><pre>if = 10<br>print(if)<br>     <br># SyntaxError: invalid syntax</pre><ul><li>Python does not limit the length of the identifiers , however as a good practice we should keep the identifiers concise and the meaningful.</li></ul><p>For Example :</p><pre>#for assigning age to a varibale <br>student_age = 25<br>a = 25 <br>print(student_age)<br>print(a)<br><br>#Although in the both of the cases , we are getting the same output , however<br><br>#as per the convention first one is preferred</pre><p><strong>Note : In Python the underscore (_) is permitted as the standalone identifer. However , from Java 9 onwards it is not allowed in case of Java.</strong></p><p><strong>CONVENTIONS IN PYTHON</strong></p><ul><li>Variables names are written in snake_case if we have more than one word , if its only one word , then it is simply written in small case letters.</li></ul><p>For Example :</p><pre>student_name = &quot;satvindersinghmavi&quot;<br>student_marks = 500<br>school = &quot;Sr. Sec School&quot;</pre><p>Function names are written same as variable names.</p><ul><li>In case of class name , if we have only one word , then the starting letter of the word should be written in the capital case and remaining letters should be written in the small case However, if we have more than one word , then we should write the class name is the PascalCase , which means that starting letter of each word should be in the capital case , and the remaining letters in the small case.</li></ul><p>For example :</p><pre>class StudentRecord:<br>    pass<br>class Student:<br>    pass</pre><ul><li>Constants are represented using all UPPER_CASE letters separated by the underscores if there are more than one word , however if we have only one word , then its written in UPPERCASE only.</li></ul><p>For Example :</p><pre>PI = 3.14159<br>MAX_STUDENTS = 100</pre><ul><li><strong>Private Identifiers Convention :</strong> If an identifier starts with the single underscore , then its considered as the private identfier , indicating not to use this outside the class/ module. Unlike Java, Python does not enforce the privacy. Meaning that in java if we declare any identifier as private it cannot be accessed outside of the class , however in python it is not the case ,It is only a naming convention , and as per this the programmers agree to follow it for cleaner code.</li></ul><pre>class Person:<br>    def __init__(self, name, age):<br>        self.name = name<br>        self._age = age   # private by convention<br>    def display(self):<br>        print(f&quot;Name: {self.name}, Age: {self._age}&quot;)<br><br># Create object<br>p1 = Person(&quot;Satvinder&quot;, 25)<br># Accessing outside the class (not recommended, but possible)<br>print(&quot;Accessing outside the class:&quot;, p1._age)<br># Best way (through method)<br>p1.display()</pre><p><strong>Strongly Private Identifiers Convention :</strong> If an identifier starts with two undescores, then it could be reffered as strongly private identifier.It can be used to avoid accidental overriding in sub class.<br>This makes it harder to access from outside the class (not impossible).</p><pre>class Cricketer:<br>    def __init__(self, name, runs):<br>        self.name = name<br>        self.__runs = runs  <br>def show_runs(self):<br>        print(f&quot;{self.name} has scored {self.__runs} runs.&quot;)<br><br>player = Cricketer(&quot;Joe Root&quot;, 12000) # Create object<br><br>player.show_runs() # accessing using method inside the class <br><br># print(player.__runs)  # Trying to access directly hence will get error<br>print(&quot;Accessing using name mangling:&quot;, player._Cricketer__runs)<br># output<br>Joe Root has scored 12000 runs.<br>Accessing using name mangling: 12000</pre><p><strong>Special Identifiers Convention : </strong>Identifiers that starts and end with the underscore character are reserved by the python for the special use. These are language specific identifiers.</p><p>For Example :</p><pre>class Cricketer:<br>    def __init__(self, name, runs):<br>        self.name = name     <br>        self.runs = runs   <br><br>    def display(self):<br>        print(f&quot;{self.name} has scored {self.runs} runs.&quot;)<br><br>player1 = Cricketer(&quot;Yuvraj Singh&quot;, 120)<br>player2 = Cricketer(&quot;Suresh Raina&quot;, 80)<br>player1.display()   <br>player2.display() <br>  <br>#Output <br> Yuvraj Singh has scored 120 runs.<br> Suresh Raina has scored 80 runs.  </pre><p><strong>Enote :<br></strong>__init__ : constructor</p><p>__str__ : string representation</p><p>__len__ : length method for custom objects</p><p>__name__ : tells if a script is run directly or imported</p><p><strong>Summary Of Rules of Identifier naming in Python :</strong></p><ul><li>(a-z , A-Z , 0–9 , _ )</li><li>does not start with digit</li><li>case sensitive</li><li>reserved words cant be used as identifiers</li><li>no length limit</li></ul><p><strong>Summary Of Conventions in Python :</strong></p><p>varibale and method name in small_case</p><p>class name in PascalCase</p><ul><li>_var =&gt; private variable</li><li>__var =&gt; strongly private</li><li>__var-__ =&gt;python language specific</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mm7fb2cNMXAAM24hNMY7MA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c263a643660a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Features Of Python #PythonForDataScience-02]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/features-of-python-pythonfordatascience-02-323ab0e2064a?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/323ab0e2064a</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 09:45:19 GMT</pubDate>
            <atom:updated>2025-11-24T09:45:19.516Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Features of Python:</strong></p><ul><li>Simple</li><li>Platform Independent</li><li>Portable</li><li>Interpreted</li><li>Extensible</li><li>Free Ware and Open Source</li><li>Dynamically Typed</li><li>High Level</li><li>Extensive Library Support</li></ul><p><strong>Simple</strong></p><p>Its easy to learn. The syntax of Python is simple, Its more or less English type language only.</p><p>Suppose if we want to write a program for displaying Hello World in Java then the code will be :</p><pre>public class Test {<br>    public static void main(String[] args) {<br>        System.out.println(&quot;Hello, World!&quot;);<br>    }<br>}</pre><p>In java , it is must to use class and main method, However in python we can do the same thing without using these extra lines.<br>Same code if we will write in python it would simply be written as :</p><pre>print(&quot;Hello, World!&quot;)</pre><p><strong>Platform Independent</strong></p><p>It means that the same python program can run on different operating system. In other words we can say that Python exhibits the “WORA” feature that is : WRITE ONCE RUN ANYWHERE.</p><p>Pythons program is not directly converted into the underlying machine code. Instead it undergoes the following Steps :</p><p><strong>Step 1 :</strong> Source code is written as stored as .py file .</p><p><strong>Step 2 :</strong> Python interpreter converts the code into the bytecode .</p><p><strong>Step 3:</strong> Python Virtual Machine converts the bytecode into the underlying machine code as the executable code .</p><p><strong>Portable</strong></p><p>Portability is about taking a program from one environment to another.</p><p><strong><em>Difference Between Python Being Portable and Python Being Platform Independent :</em></strong></p><p>Python being platform independent is a feature of the language that allows code to run on any OS (Platform) whereas , Python being portable states that , its the feature of the language that allows it to be moved and executed across different systems without changes.</p><p><strong>Interpreted</strong></p><p>Python is called an interpreted language because we do not need to compile our programs separately before running them. When we execute a Python script, the interpreter first converts the source code into bytecode, and then the Python Virtual Machine (PVM) executes this bytecode line by line. This is why errors in Python are shown at runtime, exactly where they occur. The presence of an interactive shell (REPL) also proves that Python executes code immediately, just like other interpreted languages. Although Python internally performs a small compilation step into bytecode, from a programmer’s perspective it behaves like a fully interpreted language.</p><p><strong>Note :</strong> Java is both <strong>compiled</strong> as well as i<strong>nterpreted</strong> programming language.</p><p><strong>Extensible</strong></p><p>Python allows us to write some parts of a program in Python and some parts in other languages like C/C++ for better performance or to use existing libraries.</p><p><strong>Free ware and Open Source</strong></p><p>The software of python is freely available to install and its source code is open to all , hence certain enhancements could be made in python by the people living across the globe.</p><p><strong>Dynamically Typed</strong></p><p>Let use try to understand this by comparing Java code and Python Code .</p><p>First let us look at Java code :</p><pre>public class Test {<br>      public static void main (String[] satvindersinghmavi){<br>            int x = 5;<br>            x = true;<br>  }<br>}<br>/*<br>At the compile time itself we have got error demonstrating:<br>javac Test.java<br>Test.java:7: error: incompatible types: boolean cannot be converted to int<br>  x = true; */</pre><p>Now let us try to write the same code in Python :</p><pre>x = 5 <br>print(type(x)) #&lt;class &#39;int&#39;&gt;<br>x = True<br>print(type(x)  #&lt;class &#39;bool&#39;&gt;</pre><p>In Python, x changed from int to Boolean without causing any kind of error. It got possible because python checks the type of the variable at the runtime (i.e. dynamic typing).</p><p><strong>High Level</strong></p><p>Python is far from the machines. It is easily understood able by the humans .</p><p><strong>Extensive Library</strong></p><p>Python is often described as a “batteries included” language because of its rich library support. It comes with built-in modules like math and datetime for core programming, and has powerful external libraries such as NumPy and Pandas for data science, Matplotlib and Seaborn for data visualization, and TensorFlow or scikit-learn for machine learning. In addition, Python makes web development easier with frameworks like Django and Flask, supports automation with tools like Selenium and pyautogui, and also provides libraries for working with databases, networking, IoT, and even cloud services. Thanks to this vast ecosystem, Python can be used in almost every domain, from simple scripting to advanced AI applications .</p><p><strong>For example :</strong></p><pre>import math<br>num = 25<br>result = math.sqrt(num)<br>print(&quot;Square root of&quot;, num, &quot;is&quot;, result)</pre><p>As we know that each programming language may have its own features and limitations, Likewise Python has some <strong>Limitations</strong> which are discussed as follows:</p><p>* Python is an Interpreted programming language , and hence by this fact we already know that , the translation of the code from the source code to the target code and wise versa happens line by line , which ultimately leads to the slow execution, <strong>as a result of which we can say that performance wise python is not so good !</strong></p><ul><li>Therefore , its not suitable for embedded programming as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTQoH9IfC23cm5KwQjTaMg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=323ab0e2064a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[History Of Python #PythonForDataScience-01]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/history-of-python-pythonfordatascience-01-5950622a9340?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5950622a9340</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 09:33:59 GMT</pubDate>
            <atom:updated>2025-11-24T09:33:59.038Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>History Of Python</strong></p><p>Python was developed in 1989 by Guido van Rossum.<br>It was officially released on 20 February 1991.<br>The name Python was inspired by the British comedy series “Monty Python’s Flying Circus”, not the snake.</p><p><strong>Note :</strong></p><p>Python is an excellent choice as a first programming language because of its simple and readable syntax</p><p><strong>Use cases of Python:</strong></p><p>It is a general-purpose programming language, widely used in:</p><p>Desktop Applications<br>Web Development<br>Data Analytics<br>Data Science<br>Artificial Intelligence (AI)<br>Machine Learning (ML)<br>Internet of Things (IoT)<br>Embedded Systems</p><p><strong>Programming Paradigms supported by python:</strong></p><p>*Functional programming<br>*Object-oriented programming<br>*Scripting<br>*Modular programming</p><p>When Python was created, its syntax was designed by taking inspiration from C, ABC language, and other languages available at that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbC3g4TquSznYPPNU17-0A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5950622a9340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Central Tendency (Mean,Median,Mode) (Statistics For Data Science #4)]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/what-is-central-tendency-mean-median-mode-statistics-for-data-science-4-19bdef274cd8?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/19bdef274cd8</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 10:25:25 GMT</pubDate>
            <atom:updated>2025-11-23T13:30:27.261Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Central Tendency?</strong></p><p>Central Tendency refers to the method of describing the center of a data set. It represents a point around which the data values cluster. It is basically a way to summarize and understand the overall pattern of a data set.</p><p>The advantage of using central tendency is that we can represent an entire data set using <strong>just one value</strong>, instead of showing all individual values. This single value gives us an overall idea about the data.</p><p>A measure of central tendency includes the common methods used to find this central value — mainly the <strong>mean, median, and mode</strong> of a data set.</p><p><strong>What is mean ?</strong></p><p>The mean is the <strong>average</strong> of a given set of numbers. It is calculated by adding all the values in the data set and then dividing the sum by the total number of values. It is basically the balance point of the data.</p><p>For both <strong>sample data and population data</strong>, the formulas to calculate the mean are slightly different.<br>Population mean is used when you have data for the entire population.<br>Sample mean is used when you take a part (sample) of the population.</p><p><strong>Population mean, μ or mu = ( Σ Xi ) / N</strong></p><p>where</p><p>Xi = each value in the population <br>N = total number of values in the population</p><p><strong>Sample means, x̄ = ( Σ xi ) / n</strong></p><p>where <br>xi = each value in the sample<br>n = total number of values in the population</p><p>There are certain types of the mean, like :</p><p><strong>Arithmetic mean :</strong> Used to find simple average of all values.<br><strong>Geometric mean :</strong> Used when values get multiplied or grow proportionally.<br><strong>Harmonic mean :</strong> Used when dealing with rates, speed, or ratios .<br><strong>Weighted mean :</strong> It takes into account the importance of each value in data set.<br><strong>Truncated mean :</strong> Remove extreme values (outliers) and then calculate the mean.</p><p><strong>Limitations of the mean:</strong><br>It is sensitive to the outliers. <br><strong>Scenario:</strong> Calculate average Salary in a Company</p><p>Suppose you want to calculate the average of employees in a company.</p><p><strong>Here is the salary data (in ₹):</strong></p><p>(30,000), (50,000) , (35,000) , (41,000), (3,00,000)<strong> </strong><br><br>The mean of this data set is 91,200. Just because of the outlier (3,00,000), the mean value is shifted significantly away from the typical salaries.</p><p>The plot for the above data will be left skewed, hence mean will not be the accurate measure of central tendency in the above example.</p><p><strong>Note:</strong> Only mean does not explain you the full story, its a good tool however its not everything about the data.</p><p><strong>Solution to the above: We can use median.</strong></p><p><strong>What is Median?</strong></p><p>Median is basically the central point of the data set.<br>Equal number of data set is available at both the sides of the median.</p><p><strong>Formula for calculating the medium for odd number of terms(n):</strong></p><p>median = ( (n+1) / 2 )th term , where ‘n’ is total number of terms present.</p><p><strong>Formula for calculating the medium for even number of terms(n):</strong></p><p>median = [ (n / 2 )+ ( n/2 + 1) ]th term, where ‘n’ is total number of terms present.</p><p>Now, Let us calculate the median for the above example:</p><p><strong>Here is the salary data (in ₹):</strong></p><p>(30,000), (50,000) , (35,000) , (41,000), (3,00,000)</p><p>Let us first arrange the above data in ascending or descending order:<br>(30,000), (35,000), (41,000) , (45,000) , (3,00,000)</p><p>The median of this data is : 41,000</p><p>Despite the presence of an outlier (3,00,000), it <strong>does not affect the median</strong>, because the median depends only on the middle value and not on extreme values.</p><p>Example: 10, 14, 18, 22, 30, 34<br>In this case the median will be (18+22)/2 = 20.</p><p><strong>Note:</strong> In real estate, when determining the average income or property prices, we often prefer using the <strong>median</strong> because it is not affected by extreme values (outliers). This gives a more accurate representation of the typical income or price in the market.</p><p><strong>Note :</strong> The mesaure of central dependency like mean and median are used in case of the Numerical data sets.</p><p><strong>Limitation of the Median :</strong></p><p>It is useful only in case of the Numerical data , in which the outliers are present.Median fails in cases where the data is categorical or when we need the most frequently occurring value. In such cases, mode becomes the best measure of central tendency.</p><p><strong>What is mode ?</strong></p><p>Mode is the value that occurs most frequently in a data set.</p><p>For example: 2,2,3,3,4,5,6,7,7,8</p><p><strong>Note:</strong> We can have more than one mode values for a given dataset.</p><p>In the above example the mode values are : [2 3 7]<br>The first mode is 2.<br>The second mode is 3.<br>And the third mode is 7.</p><p><strong>Note:</strong> Mode is frequently used in E-commerce, getting the market trends,SEO, etc.</p><p>For example: A clothing company analyzes which shirt size customers buy most frequently.<br>M, L, L, M, L, XL, M, L, S, L<br>Mode is L.</p><p><strong>TakeAway:</strong></p><p>Every measure of central tendency (mean, median, and mode) has its own importance. No industry relies only on one measure. Different situations require different measures depending on the nature of data and the purpose of analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAM_RTyyU9XSIU0KPEnwsA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19bdef274cd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Type Of Statistics (Statistics For Data Science #3)]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/introduction-to-type-of-statistics-statistics-for-data-science-3-58b76a25da76?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/58b76a25da76</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 23:25:38 GMT</pubDate>
            <atom:updated>2025-11-18T23:25:38.645Z</atom:updated>
            <content:encoded><![CDATA[<p>There are two main branches of statistics:</p><p>1. Descriptive Statistics</p><p>2. Inferential Statistics</p><p><strong>Descriptive Statistics</strong> involves the collection, summarization, and presentation of data using various measures, such as:</p><p><strong>Measures of Central Tendency </strong>(e.g., mean, median, mode)<br><strong>Measures of Dispersion</strong> (e.g., range, variance, standard deviation)</p><p><strong>Note: </strong>We will discuss about these measures later on.</p><p><strong>Example of Descriptive:</strong></p><p>Let’s consider a top-level school in a district, where the faculty is highly qualified and the students are hardworking. The school administration collects data on the students’ performance in the class 12 English exam, such as the average score, the highest and lowest scores, and the range of scores. After summarizing the data, it is observed that the average score was 55%, with the highest score being 90% and the lowest score being 25%. The data also reveals that most students scored between 40% and 70%. This provides a clear summary of the performance of the students in that specific exam.</p><p><strong>Inferential Statistics</strong> involves drawing conclusions or making inferences from a sample of data using statistical methods (such as the Z-test, t-test, etc.). In this case, experiments are conducted on the sample data, and conclusions are made about the larger population. In other words, inferential statistics allows us to make predictions or generalizations about a population based on the sample data.</p><p><strong>Example of Inference:</strong></p><p>Let’s consider a top-level school in a district, where the faculty is highly qualified and the students are hardworking. However, the students’ performance in the class 12 English exam was quite poor, as the exam was perceived as difficult and lengthy. From this, we can infer that students in other schools may have faced similar or more challenges.</p><p><strong>Note:</strong></p><p>* Under Descriptive Statistics, certain measures are used to summarize and interpret sample data.<br>* Under Inferential Statistics, experiments are conducted on sample data, and inferences are made about the larger population.<br>* The population is denoted by ’N’ and the sample data is denoted by ‘n’.</p><p>We can say that Descriptive Statistics is all about <strong>summarizing/segmenting</strong> and understanding the sample data, while Inferential Statistics is about drawing <strong>inferences or conclusions</strong> about the population (large data).</p><p><strong>Sample data</strong> is a subset of the<strong> population. </strong>It may be difficult to analyse the entire population, but by identifying patterns in the sample data, we can infer how the population might behave.</p><p><strong>Understanding the sample data and population</strong></p><p>In the following discussion, 50 represents the sample data, while the total number of students in the school represents the population.</p><p>Imagine a school wants to know the average height of all its students (population). Measuring every single student’s height might be time-consuming. So, instead of measuring everyone, the school decides to measure the heights of 50 students randomly selected from different classes (sample data).</p><p>Once they collect the heights of these 50 students, they calculate the average height from the sample. By looking at this sample data, the school can make an inference about the average height of all the students in the school. If the sample is representative, they can reasonably assume that the average height of the entire school will be similar to the average of the sample.</p><p><strong>Descriptive Statistics V/S Inferentiel Statistics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0bJ8Wu1Hc_4_LziGvzwOw.jpeg" /></figure><p><strong>Takeaway:<br></strong> We use statistics to summarize and segment data.<br>For numerical data, summarization involves measures like the mean, median, and data spread.<br>When working with categorical data, segmentation groups the data into categories or clusters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyWY-EQOGCMq6_48HzeGLw.jpeg" /></figure><p><strong>Click Below For the Previous Article: Statistcs For Data Science #2</strong></p><p><a href="https://medium.com/@imsatvindersinghmavi/types-of-data-statistical-data-for-data-science-7a2b2b3b6038">https://medium.com/@imsatvindersinghmavi/types-of-data-statistical-data-for-data-science-7a2b2b3b6038</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58b76a25da76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types Of Statistical data (Statistics For Data Science #2)]]></title>
            <link>https://medium.com/@imsatvindersinghmavi/types-of-data-statistical-data-for-data-science-7a2b2b3b6038?source=rss-87ca4eff25fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a2b2b3b6038</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[satvinderinghmaviDataScience]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 19:15:44 GMT</pubDate>
            <atom:updated>2025-11-18T22:55:39.189Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Why is there a need to classify the type of data?</strong></p><p>We need to classify the type of the data for :</p><p>*Right Analysis<br>*Suitable Visualizations<br>*Extract Accurate Insights</p><p><strong>For example:</strong></p><p>The type of data specifies which statistical tool (or test) we are allowed to use. If we do not appropriately scale the data, we may choose the wrong measures to analyse it and may interpret incorrect results. Hence, it is important to classify the type of data so that it can be labelled(scaled) accurately and measured with no or minimal error.</p><p><strong>What is qualitative data and quantitative data?</strong><br>The data that can be measured under the Nominal or Ordinal scale is referred to as “Qualitative Data.” It is also called categorical data.<br>The data that can be measured under the Interval or Ratio scale is referred to as “Quantitative Data.” It is also called numerical data.</p><p><strong>Note:</strong></p><p>Sometimes people represent “Yes” and “No” responses as “1” and “0.” But using numbers in this way does not make the data ordinal — the scale is still nominal, because the values are just labels, not ordered quantities</p><p>Consider customer IDs like 101, 102, and 103. Even though they are numerical, they should be treated as qualitative (categorical) data, because the numbers are simply identifiers and don’t carry quantitative meaning</p><p><strong>Why is data scaled?</strong><br>We scale data because we need to measure the data, analyse the data, and obtain the corresponding interpretations. Based on these interpretations, we make certain decisions, which can be beneficial in answering scientific problems, helping us face industrial challenges, and supporting other sectors such as medical, health, and education.</p><p><strong>Types Of Data:</strong></p><p>There are mainly two types of data: <strong>numerical (quantitative) data and categorical (qualitative) data</strong>. In our learning phase, we often encounter numerical data a lot, but in real-world work, we deal with categorical data very frequently.</p><p>In addition to the basic split between <strong>categorical (qualitative)</strong> and <strong>numerical (quantitative)</strong> data, there are other important ways to classify data in data science:</p><p><strong>1.Structured Data:</strong><br>Structured data is organized in a predefined format, often in rows and columns, typically stored in database tables, making it easy to search and analyse. Each piece of data is well-defined and categorized.<br><strong> Example:</strong><br> -&gt; A customer database where each entry has fields like name, age, and address. It helps organize and analyse customer information efficiently for better decision-making and targeted marketing.</p><p><strong>2.Unstructured Data:</strong><br>Unstructured data does not follow a predefined structure. It can be text-heavy and may include formats like images, audio, video, and web pages.<br><strong>Note: </strong>Unstructured means it does not fit into conventional data storage formats.<br><strong>Example:</strong><br> -&gt; Customer reviews in text form, audio recordings of service calls, or images uploaded to an online store. This data helps analyse customer sentiments, feedback patterns, and visual content to improve products and customer experience.</p><p><strong>3.Cross-Sectional Data:</strong><br>This type of data is collected at a single point in time or over a short period. It captures a snapshot of a particular moment.<br><strong> Example:</strong><br> -&gt; A survey conducted on customer purchasing behaviour during a particular month. It reflects preferences at that specific point in time.</p><p><strong>4.Time Series Data:</strong><br>Time series data is collected or recorded at regular intervals over a period. It allows for trend analysis and forecasting.<br><strong>Note:</strong> Time series data may be collected by humans or recorded by machines.<br><strong>Examples:</strong><br> -&gt; Daily stock prices of a company.<br> -&gt; Daily temperature readings over a year.<br> -&gt; Monthly sales revenue of a store.</p><p><strong>5.Univariate Data:</strong><br>Univariate data refers to data collected for a single variable or attribute.<br><strong> Example:</strong><br> -&gt; Heights of students in a class.</p><p><strong>6.Multivariate Data:</strong><br>Multivariate data involves collecting information on multiple variables simultaneously, allowing deeper analysis and understanding of relationships. It is commonly used to study complex phenomena where multiple factors influence an outcome.<br><strong>Note:</strong> It forms the foundation of many machine learning models.<br><strong> Example:</strong><br> -&gt; A survey collecting students’ height, weight, and age to analyse relationships like BMI trends.</p><p><strong>7.Boolean Data:</strong><br>Binary data consists of only two possible values. It is a special type of discrete data where the values typically represent categories such as yes or no, true or false, or 0 and 1.<br><strong>Examples:<br>-&gt; </strong>Medical diagnosis, indicating whether a disease is present (1) or absent (0).<br>-&gt; Online advertisement click prediction, where a click is recorded as 1 and no click is recorded as 0.</p><p><strong>8.Semi-Structured Data:</strong><br> It is a mix of structured and unstructured data.<br> <strong>Example:</strong><br>-&gt;Emails:<br> The header portion of an email is structured.<br> The body portion of an email is unstructured.</p><p><strong>9.Discrete Data:</strong><br>Discrete data refers to data that can be counted and takes only distinct, separate values. These values are usually whole numbers, and fractions are not possible. In data science, discrete data is used when the information represents counts.<br><strong>Examples:</strong><br>-&gt;The number of website visits made by users.<br>-&gt;The number of products purchased in a single order.<br>-&gt;The number of failed login attempts, often used in fraud analysis.</p><p><strong>10.Continuous Data:</strong><br>Continuous data represents values that can be measured and can take any value within a given range, including decimals and fractions. This type of data does not have gaps between values. Continuous data appears when variables need to be recorded with precision.<br><strong>Examples:</strong><br>-&gt; Time spent by users on an app or website, measured in seconds or minutes.<br>-&gt; Temperature collected from sensors, often used in predictive maintenance or weather forecasting.<br>-&gt; Age, height, or weight of individuals in health analytics models.<br>-&gt; The speed of vehicles, used in traffic analysis and autonomous driving systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*iLAytcqgj3lYFFQyVUMrJA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a2b2b3b6038" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>