Chris Conlan

Financial Data Scientist

  • About
  • Blog
    • Business Management
    • Programming with Python
    • Programming with R
    • Automated Trading
    • 3D Technology and Virtual Reality
  • Books
    • The Financial Data Playbook
    • Fast Python
    • Algorithmic Trading with Python
    • The Blender Python API
    • Automated Trading with R
  • Snippets

70+ Code Profiles of Common Python Algorithms

June 1, 2020 By Chris Conlan Leave a Comment

I just released my latest book, Fast Python: Master the Basics to Write Faster Code. In it, you will find a blend of academic discussion of algorithms and a pragmatic optimizations of computation time.

Whether or not you are interested in buying the book, I wanted to share some free resources from the accompanying GitHub repository. These code profiles can be run as stand-alone scripts. They show how different versions of the same algorithm perform across different sizes of input arguments. The charts and tables are pretty cool. I hope others can find use in the accompanying profiling library, as well.

  • Binary search: binary_search.py
  • Dictionary construction: build_dict.py
  • Concatenating strings, string construction: concatenate_strings.py
  • Counting the frequency of a value: count_occurrences.py
  • Computing a cumulative sum: cumulative_sum.py
  • The in operator and early stopping: early_stopping.py
  • Time series filters/convolutions: filters.py
  • Find largest k values in a list: find_top_k.py
  • List construction/declaration/flattening: flatten_lists.py
  • Counting lines in a file: line_count.py
  • Set intersection, finding matches in a list: match_within.py
  • Matrix multiplication: matrix_multiplication.py
  • Computing moving averages: moving_averages.py
  • Counting frequency of a word in text: occurrences_of.py
  • Looping through pd.DataFrame objects: pandas_loops.py
  • Sorting algorithms: sorting.py
  • Low-level sorting algorithms: sorting_v2.py
  • Adding a list of numbers: sum.py

Filed Under: Programming with Python

Leave a Reply Cancel reply

Fast Python: Master the Basics to Write Faster Code

Fast Python: Master the Basics to Write Faster Code

Available for purchase at Amazon.com.

Featured Posts: Python Programming

Pulling All Sorts of Financial Data in Python [Updated for 2021]

When to Use Heap Sort to Speed Up your Python Code

Fastest Way to Flatten a List in Python

Topics

  • 3D Technology and Virtual Reality (8)
  • Automated Trading (9)
  • Business Management (9)
  • Chris Conlan Blog (5)
  • Computer Vision (2)
  • Programming with Python (16)
  • Programming with R (6)
  • Snippets (8)
  • Email
  • LinkedIn
  • RSS
  • YouTube

Copyright © 2022 · Enterprise Pro Theme On Log in