Skip to content

harshaswamireddy/python-numpy-foundations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Python & NumPy Foundations: Core Programming & Interview Algorithms

A clean, comprehensive collection of solutions to core Python and NumPy programming challenges. This repository focuses on writing optimized, readable code for algorithm practice, data structure manipulation, and vectorized array calculations without relying on external libraries.

πŸ“Œ Project Overview

This repository contains a single Jupyter Notebook (DA_DS_WEEK1_ASSIGNMENT_5.ipynb) that covers fundamental to advanced concepts in Python and NumPy. The exercises are structured into three logical sections:

  • Section A: Theoretical Foundations β€” Deep-dive analysis of memory references, mutable vs. immutable types, floating-point arithmetic errors, and hash-table performance.
  • Section B: Code Execution & Output Prediction β€” Demonstrations of shallow copying, mutable default parameters, scoping rules, and short-circuit evaluation.
  • Section C: Algorithmic Implementation β€” Implementations of core computer science algorithms and mathematical models from scratch.

πŸ› οΈ Key Topics & Implementations

1. Core Python Algorithms

  • Arithmetic & Type Parsing: Value swapping methods (XOR, arithmetic, unpacking), and dynamic type detection.
  • Logic & Slab Calculations: Income tax and electricity bill slab-based calculators.
  • Pattern Generations: Loop-driven numerical and string-based nested patterns (diamonds, hollow squares, Pascal's Triangle).

2. Math & Loop Control

  • Armstrong Numbers: Check digit powers without string conversion.
  • Fibonacci & Primes: Non-recursive Fibonacci sequences and optimized prime number evaluations.
  • Euclidean Algorithm: GCD/HCF and LCM calculations without using built-in libraries.
  • Single-Pass String Scanner: Counts characters, words, vowels, consonants, digits, spaces, and special symbols in a single iteration.

3. Data Structures & String Manipulation

  • Custom Array Operations: Finding maximum, minimum, average, and second-highest elements without sorting.
  • CRUD Menu Simulator: Pre-populated database dictionary operations.
  • Set Operations: Intersection, union, difference, and symmetric difference challenges.
  • Custom Duplicates Counter: List analysis without importing Counter.
  • Ciphers & Formatting: Caesar Cipher encryption and manual title casing.

4. Advanced Concepts & Recursion

  • Recursive Math: Custom power function handling negative exponents.
  • NumPy Vectorization: Creating, transposing, and tracing identity matrices.
  • Loop-Free Slicing: Modifying multi-dimensional borders and extracting sub-arrays without explicit loops.

πŸš€ Getting Started

Prerequisites

Make sure you have Python 3.x and the required libraries installed:

pip install numpy jupyter

About

A comprehensive set of optimized solutions to core Python programming challenges, data structures, recursion, and vectorized NumPy operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors