Posts

Showing posts from March, 2025

Python_Lists_Loops

#Ex: Iterating Through a List of fruits in the list ["apple", "banana", "cherry"] 1. using For loop using range and len functions. 2. without range and len functions fruits = ["apple", "banana", "cherry"] While loop : index = 0 while index <= len(fruits): print(colors[index]) index = index + 1 For loop Type#1: for fruit in range(len(fruits)+1): print(fruit) ________________________________________________________________________________________________________________________ #Ex: Iterating Through a List of numbers in the list numbers = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ] 1. using For loop using range and len functions. 2. without range and len functions numbers = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ] For loop Type#1: for i in range(len(numbers)+1): print(f"Index {i}: {numbers[i]}") For loop Type #2: for i in numbers: print(f"Index {i}: {numbers[i]}") While...

Python_Lists

# Create a List with Fruits with Items Banana, apples # Display the total number of items in the list # Append the fruit Manago to the list # display the total number of items in the list ________________________________________________________________________________________ # Create a List with Fruits with Items Banana, apples # display the list from begining to ending # display the list from ending to begining ________________________________________________________________________________________ family = [ "Mother" , "Father" ] print ( "List is :" ) print (family) print ( "Total number of items in the list :" , len (family)) print ( f"_______________________________" ) print ( f"List in normal order" ) print ( f"_______________________________" ) print ( "Index : 0 " , family[ 0 ]) print ( "Index : 1 " ,family[ 1 ]) print ( f"_______________________________" ) print ( f"List ...

python pandas

Image
 Pandas  = Its name is short after “ pan el da ta s tructures” Pandas is an extension of Python related to Analytics Install Anaconda distribution https://www.anaconda.com/download https://www.anaconda.com/docs/main Anaconda navigator https://jupyter.org/ https://pandas.pydata.org/   Create a new environment with name “Pandas-Playground” Added the Pandas Bottleneck Numexpr     In jupyter For each code in cell > will be executed by python server ( kernel) which listens continuously for the commands Shutdown after all closing the files     Jupyter notebook Jupyter Code cell Notebook                 Edit mode ( mouse click )                 Command mode ( escape  key )            ...