Skip to content

Hamama-Komal/Python_Lectures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Learning Repository for Machine Learning

This repository contains a structured collection of Python code examples and explanations, specifically designed for learning Python fundamentals and special functions. It provides foundational knowledge required for diving into Machine Learning (ML) and data science, covering basic Python programming to more advanced topics such as functions, comprehensions, and modules.

The content is divided into multiple sections, each focused on a specific concept that is frequently used in Python programming and ML workflows. Whether you're a beginner or preparing to get into ML, this repository is a comprehensive guide to mastering Python basics and essential functions.


Table of Contents

  1. Basics of Python
  2. Strings in Python
  3. Booleans in Python
  4. User Input Handling
  5. Data Structures
  6. Functions
  7. Special Functions
  8. Comprehensions
  9. Modules and Packages

1. Basics of Python

This section introduces basic Python syntax and concepts such as function declaration, function calling, loops, and conditionals. These concepts are essential for structuring any Python code, including ML models.

Files:

  • 01_basics.py: Introduction to functions and function calling.
  • 02_strings.py: String operations, slicing, and string manipulation.
  • 03_booleans.py: Boolean values and operations.
  • 04_exercise.py: A small exercise on string encryption.
  • 05_lists.py: Lists, list operations, and methods.
  • 06_type_casting.py: Explicit and implicit type casting in Python.
  • 07_input.py: Taking input from the user and type handling.

2. Strings in Python

Strings are a vital data type in Python, and understanding how to manipulate them is crucial for text data processing, which is commonly used in ML applications like Natural Language Processing (NLP).

Files:

  • 08_dictionaries.py: Introduction to dictionaries, key-value pairs, and dictionary methods.
  • 09_tuples.py: Tuples, immutability, and tuple methods.
  • 10_sets.py: Sets in Python and their unique properties.
  • 11_conditionals.py: Conditional statements like if, elif, and else.
  • 12_loops.py: Loops in Python – for and while loops.
  • 13_range.py: Using range() to generate sequences.
  • 14_loop_controls.py: Break, continue, and pass for controlling loop behavior.

3. User Input Handling

Understanding how to handle user input is essential, especially when building interactive applications and systems, including ML model deployment.

Files:

  • 15_function_basics.py: Basic function structure and how to define and call functions.
  • 16_function_parameters.py: Positional, default, and keyword parameters in functions.
  • 17_return_values.py: Working with return values in functions.
  • 18_docstrings.py: Adding documentation to your functions using docstrings.
  • 19_args_kwargs.py: Understanding *args and **kwargs to handle flexible arguments in functions.
  • 20_function_scope.py: Exploring local, global, and non-local scope in functions.

4. Data Structures

Data structures are the foundation of organizing and storing data, a key aspect of any ML workflow.

Files:

  • 21_good_function_qualities.py: Writing clean and efficient functions.
  • 22_map_function.py: Using map() to apply functions to sequences.
  • 23_filter_function.py: Using filter() to filter data based on a condition.
  • 24_zip_function.py: Combining multiple iterables using zip().
  • 25_reduce_function.py: Reducing a list into a single value using reduce() from functools.

5. Special Functions

These are higher-order functions that are used frequently in data processing tasks, especially in data science and ML.

Files:

  • 26_list_comprehension.py: Creating lists in a concise and readable manner using list comprehension.
  • 27_set_comprehension.py: Set comprehension for creating sets.
  • 28_dict_comprehension.py: Creating dictionaries using comprehension for cleaner and more efficient code.
  • 29_modules_and_packages.py: Introduction to Python modules and packages, which are essential for organizing larger Python projects, including ML projects.

6. Comprehensions

List, set, and dictionary comprehensions allow you to write more concise and readable code, which is extremely useful when working with data.


7. Modules and Packages

Modules and packages help organize Python code into reusable components. In ML projects, modules can be used to manage code for data loading, preprocessing, training, and evaluation.


Getting Started

1. Clone this repository:

git clone https://github.com/Hamama-Komal/Python_Lectures.git

About

Basics of Python for Machine Learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages