Skip to content

bropenguin847/Python-Learning

Repository files navigation

📖 Python Learning 🚀

For Scientific Programming Course which introduces the fundamentals of Scientific Programming. The focus is on programming fundamentals, algorithm implementation, program design, and visualization, aiming to develop skills in scientific computing along with tools and techniques for solving engineering challenges.

There are 12 chapters in Scientific Programming course:

  • Chapter 1: Overview of Languages
  • Chapter 2: Introduction to Programming Platform (Python)
  • Chapter 3: Complex Data Type
  • Chapter 4: Control FLow
  • Chapter 5: Functions
  • Chapter 6: Input & Output
  • Chapter 7: Debugging [Excluded]
  • Chapter 8: Graphics
  • Chapter 9: Data Interpolation
  • Chapter 10: Polynomials
  • Chapter 11: Data Analytics
  • Chapter 12: Object Oriented Programming (OOP) [Excluded] The notes for the excluded slides will still be provided

🐍🐍🐍

This repo is currently used as my personal notes, with scripts to aid my learning.

I would like to keep this as my way of learning how to maintain a repo, make documentation that is neat and user friendly.

In the future, perhaps I will make a wiki page for all the shortcuts to learn Python.


Contains notes for each chapter. Notes will be continually updated. For array notes, contain specific notes regarding numpy arrays, numpy functions and so on. Further references can be found in the appendix.


In exercises folder, contain exercises for python, such as array manipulation, bubble sort and mistakes that I have made during my tests (regretting life)


In the assignment folder, contains 3 tasks. All requires using Python to extract data from csv file using Python libraries such as Pandas.

In all the .py file, the problem scenario's are stated on the top. datastat_module is a custom Python file that contains all the functions that can help out with the other files. It is essentially a custom library.

For the data in Assignment, outliers and missing values have been added in the .csv files


Scripts 📝

All the folders labeled with Chapter contain scripts for each chapter. Some have xlsx or csv files used as data. Feel free to try it out.

Some Python files are combined together to reduce clutter and because the codes are very similar. Such as example1&2 are combination of example1 and example2 in Chapter 4.

In Chapter 8, the folder 'Signals' is for Signals and System course. It's an assignment, the code is an alternative to plotting graphs using MatLab. However, a MatLab version of the code is also available.

Chapter 7 (Debugging) and Chapter 12 (OOP) is not included in this repo, but I will try to find the notes for both of those chapter.

Additional links for Debugging and OOP:
Debugging in VS Code
OOP


Setup

This course uses Python as its high level programming language with various libraries such as NumPy and Matplotlib, with VSCode as IDE. A few setups are required when programming Python using VSCode. Here are the steps. Users will need to manually install Python and the libraries as well.

Alternatively, SpyderIDE can be used. Spyder IDE offers an integrated environment combining an editor, console, and variable explorer, making it ideal for scientific computing. It supports data visualization, efficient debugging, and preinstalled with libraries like NumPy, Pandas, and Matplotlib.

IDE Advantages Disadvantages
VSCode Vast library of extensions, built-in version control, versatile for various programming languages Steep learning curve, manual setup for each language
Spyder Strong focus on scientific programming, integrated variable explorer and plotter, easy to use Limited extensions, less versatile

Pick your poison and learn Python


Libraries 📖

Numpy, Matplotlib, Pandas & SciPy. With links for official documentation.

python -m pip install numpy
python -m pip install matplotlib
python -m pip install pandas
python -m pip install scipy

🎲NumPy documentation
📈MatPlotLib documentation
🐼Pandas Documentation
🐍SciPy Documentation


Appendix 📌

Cheatsheet for subscripting and operator precedence subscripting
operator precedence

All the colors for matplotlib
Simple matplotlib markers, line style and color
🔴🔵🟡matplotlib colors🟢🟠🟣

How to write clean Python code
Pep8 Style Guide for Python Code

Python SpeedSheet


For beginners / Helpful Links

CS50 Introduction to Python

Python explained simply

Python Full Course for Beginners by Mosh Hamedani

Feel free to raise any issues if you found any mistakes or outdated information in this repo. Have a nice journey into the world of Python. All the best ᯓ★!!

*ੈ✩‧₊˚༺☆༻*ੈ✩‧₊˚