Contributed so kindly by Joe Wojniak It may seem obvious, but financial research requires data — and a lot of it. If financial research isn’t your day job, it can be surprisingly difficult to come by. Here are some suggestions for acquiring data to use in your financial research project. Data Sources Every project has […]
When to Use Heap Sort to Speed Up your Python Code
If you have ever read an algorithms textbook, you know about the handful of sorting algorithms that run in O(n*log(n)) time. These include quicksort, heapsort, and mergesort. Under the hood, Python’s List.sort function uses yet another one called Timsort. That’s not the point of this post. The point of this post is show you how […]
Fastest Way to Flatten a List in Python
In my latest book, Fast Python, I bust a lot of speed myths in Python. Some of the most basic advice people give about optimizing Python code is wrong, likely because no one ever bothered to test it. In this book, I go back to the basics and verify (or bust) all of the advice […]
70+ Code Profiles of Common Python Algorithms
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 […]
Multicore Repeated K-Fold Classifier
The following snippet is a reusable multicore K-Fold classifier for scikit-learn models. The return value is an array of cross validation scores of length N_SPLITS * N_REPEATS. The sklearn library already provides a simple interface for multicore cross validation through the cross_val_score function, but it does not provide a facility for repeating the cross validation […]
- 1
- 2
- 3
- 4
- Next Page »