

![logo](./Images/logo.png)


A collection of useful scripts, tutorials, and other Python-related things

<br>


<br>
<br>
<br>



###// Python tips and tutorials

- A collection of not so obvious Python stuff you should know! [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/not_so_obvious_python_stuff.ipynb?create=1)]


- Python's scope resolution for variable names and the LEGB rule [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/scope_resolution_legb_rule.ipynb?create=1)]

- Key differences between Python 2.x and Python 3.x [[HTML](http://htmlpreview.github.io/?https://github.com/rasbt/python_reference/blob/master/tutorials/key_differences_between_python_2_and_3.html)] 


- A thorough guide to SQLite database operations in Python [[Markdown](./sqlite3_howto/README.md)]  

- Unit testing in Python - Why we want to make it a habit [[Markdown](./tutorials/unit_testing.md)]  

- Installing Scientific Packages for Python3 on MacOS 10.9 Mavericks [[Markdown](./tutorials/installing_scientific_packages.md)]



- Sorting CSV files using the Python csv module [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/sorting_csvs.ipynb)]


<br>
###// benchmarks

*For more recent benchmarks, please also see my separate   
GitHub repository [One-Python-benchmark-per-day](https://github.com/rasbt/One-Python-benchmark-per-day)*

- Python benchmarks via `timeit` [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/benchmarks/timeit_tests.ipynb?create=1)]  

- Implementing the least squares fit method for linear regression and speeding it up via Cython [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/benchmarks/cython_least_squares.ipynb?create=1)]   

- Benchmarks of different palindrome functions [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/benchmarks/palindrome_timeit.ipynb?create=1)]    


<br>


###// other

- Creating a table of contents with internal links in IPython Notebooks and Markdown documents [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/table_of_contents_ipython.ipynb)]   

- Happy Mother's Day [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/funstuff/happy_mothers_day.ipynb?create=1)]

<br>

###// useful scripts and snippets

- [Shell script](./useful_scripts/prepend_python_shebang.sh) for prepending Python-shebangs to all .py files in a current directory.

- convert 'tab-delimited' to 'comma-separated' CSV files [[IPython nb](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/useful_scripts/fix_tab_csv.ipynb?create=1)]
