Pandas-Df

Wed 12 November 2025
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: py311; pyv: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]'
print(pyu.ps2("pandas"))
pandas==2.2.3
import pandas as pd
data = {'name': ['Jason', 'Molly', 'Tina', 'Jake', 'Amy'], 
        'year': [2012, 2012, 2013, 2014, 2014], 
        'reports …

Category: pandas-work

Read More

Pandas-Element

Wed 12 November 2025
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: py311; pyv: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0]'
print(pyu.ps2("pandas"))
pandas==2.2.3



Score: 0

Category: pandas-work

Read More

Pass-Statement

Wed 12 November 2025
#  created : 20250316
#  https://www.scientecheasy.com/2022/11/python-pass-statement.html/

x = 20
y = 30
if x > y:
    pass
# there will be no output for this code


Score: 5

Category: python-basics

Read More

Positive-Negative

Wed 12 November 2025
def count_numbers(lst):
    positives = 0
    negatives = 0
    zeros = 0
    for num in lst:
        if num > 0:
            positives += 1
        elif num < 0:
            negatives += 1
        else:
            zeros += 1
    print(f"Positive: {positives}, Negative: {negatives}, Zero: {zeros}")

# Example usage
count_numbers([1, -2, 0, 4, -5, 0])
Positive: 2, Negative: 2, Zero: 2


Score …

Category: python-basics

Read More

Prime-Number

Wed 12 November 2025

def is_prime(num):
    if num <= 1:
        return False
    for i in range(2, int(num**0.5) + 1):
        if num % i == 0:
            return False
    return True

# Example usage
print(is_prime(7))  # True
print(is_prime(10)) # False
True
False


Score: 0

Category: python-basics

Read More

Python-Buildin-Types

Wed 12 November 2025
#  created : 20250113
#  https://www.scientecheasy.com/2022/09/data-types-in-python.html/
#  Dynamic data

#  which means we dont want to specify a data type when assigning to a variable
#  the change in the value leads to a change in data type
my_var = "Hi Friends!" # holding string.
my_var = 25 # same variable holding numeric …

Category: python-basics

Read More

Python-Comments

Wed 12 November 2025
#  created : 20250112
#  https://www.scientecheasy.com/2022/09/comments-in-python.html/
#  in python comments are written in (#) symbol
print('Hello mate!!')  # this will not get print in the output
Hello mate!!
name = "Jerin" # Variable declaration and initialization.
print(name)
Jerin
#  multi line comments used like this 
'''
I 
am
multiline 
comments
'''
'\nI …

Category: python-basics

Read More

Python-Delimeter

Wed 12 November 2025
#  created : 20250111
#  https://www.scientecheasy.com/2022/09/reserved-keywords-in-python.html/
#  list of delimeters 
msg = 'hi jerin how are you'  # --> single quote delimeter
print(f'{msg}')
hi jerin how are you
num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # --> square braces delimiter
print(num)
[1, 2, 3, 4 …

Category: python-basics

Read More

Python-Docstring

Wed 12 November 2025
#  created : 20250113
#  https://www.scientecheasy.com/2022/09/docstring-in-python.html/
#  docstring in python 
# Function with a Docstring.
def getSum(x, y):
    """This is a docstring

    This method takes two argument values and returns the summation of it."""
    print("Sum = ", (x + y))
getSum(20, 40) # Calling function.
print(getSum.__doc__) # Calling …

Category: python-basics

Read More

Python-Indentations

Wed 12 November 2025
#  created : 20250112
#  https://www.scientecheasy.com/2022/09/indentation-in-python.html/
#  Python indentations

#  in python indendation means the whitespace 
#  after function definition we have to give four indendation
def display():
  var = "Scientech Easy" 
  print(var)
display()
Scientech Easy
def display(parameter):
    var = "Hello" 
    print(var) 
    print(var, parameter)
display("Python")
Hello …

Category: python-basics

Read More
Page 8 of 10

« Prev Next »