Posts

Python | Notes

This post is a compilation of bullet points & notes taken from a book - Head First Python (Paul Barry) Ch 5 - Building a Webapp: Getting real Python Package Index (PyPI), is a centralized repository for third-party Python modules. When connected to the internet, one can automatically install packages from PyPI using pip. Flask is a micro-web framework, that can be used to build custom web applications. The __name__ value (maintained by the interpreter) identifies the currently active module. The @ symbol before a function's name identifies it as a decorator. Decorators let you change the behavior of an existing function without having to change the function's code. In a webapp, Flask's @app.route decorator to associate URLs with Python functions. A function can be decorated more than once e.g.  @app.route('/') @app.route('/entry') def entry_page() -> 'html': return render_template('entry.html',the_title = 'Welcome to search4lett

Programming Anecdotes

Open command prompt window and change current working directory   ( Reference  -   https://stackoverflow.com/questions/4717352/open-command-prompt-window-and-change-current-working-directory)  @ECHO OFF cmd.exe /K "cd C:\desired folder path && C:" Execute batch file from Python script  ( Reference -  https://datatofish.com/batch-file-from-python/) import subprocess subprocess.call([r'C:\Users\Ron\Desktop\Run Batch\Matrix.bat'])

Python Anecdotes | Call by Value, Call by Reference

 Python - Call by Value, Call by Reference   (Ref - Head First Python | 2nd edition | Pual Barry) Depending on the situation, Python's function argument semantics support both call-by-value and call-by-reference. Variables in Python are object references. It is useful to think of the value stored in the variable as being the memory address of the value, not its actual value. Its this memory address that's passed into a function, not the actual value.  This means that Python's functions support what's more correctly called by-object-reference call semantics.  Based on the type of the object referred to, the actual call semantics that apply at any point in time can differ.  Consider following Python function definitions, these two functions are similar. Each takes a single argument, displays it on screen, manipulates its value, and then displays it on screen again. def double(arg):     """ This function doubles the value passed in"""    

Resources

Following is the collection of the Resources  Statistics The Elements of Statistical Learning (Springer) - Trevor Hastie, Robert Tibshirani & Jerome Friedman  Python Head First Python - Paul Barry [reading - Aug 2020] Data Science   Python for Data Analysis - Wes McKinney (O'Reilly, 2012) Machine Learning Introduction to Machine Learning With Python ( A Guide for Data Scientist)  - Andreas C Muller and Sarah Guido [reading - Aug 2020] Tutorials Videos