Table Of Contents 1. Why is Python A Good Fit For Algorithmic Trading? 2. What is Algorithmic Trading? 2.1. Why Python For Algorithmic Trading? 2.1.1 Is Python Really The Best Programming Language For This? 2.1.2 What makes Python a good fit for algorithmic trading? 3. Getting Started 1. Why is Python A Good Fit For Algorithmic Trading? Want to know ...
Read More »Home »
Python: PyWeek 32: Lil Miss Vampire
TL;DR A world that scrolls infinitely in any direction, an RPG-like UI, and simple, real-time fighting. My younger kids and I built this entry for PyWeek 32 based on the theme “Neverending”. The key innovations are: It has a neverending world. As the player walks along, it picks up tiles and places new ones invisibly. It uses an LRUDict to remember the ...
Read More »How to Loop Over a Dictionary in Python: Keys, Values, and More
Welcome to yet another How to Python article. Today, we’ll be looking at looping over dictionaries which appears to be a hot topic—at least by an organic standpoint. As it turns out, there are few ways to get it done. First, we could loop over the keys directly: for key in dictionary. Alternatively, we might only need to loop over the ...
Read More »Python humanize time-interval without Arrow or Humanize libraries
Sometimes when we need to debug functions in Python, we need a way to write some quick timer code to capture the time-delta and to compute the time it took for the function to execute. This article shows you a quick and easy way to humanize a time-interval/time-delta without bringing in additional dependencies or libraries like Arrow or Humanize. 1 ...
Read More »How to Split a String by Whitespace in Python: Brute Force and split()
Once again, I’m back with another look at some ways to solve a common Python problem. This time, we’ll be looking at how to split a string by whitespace (and other separators) in Python. If you’re in a rush, here’s the key takeaway. You could write your own whitespace splitting function, but they’re often slow and lack robustness. Instead, you ...
Read More »How to Convert a String to Lowercase in Python
As this series grows, I’ve started poking at seemingly simple problems to expose their complexity. This time, I thought it would be interesting to look at how to convert a string to lowercase. As it turns out, there’s a really straightforward solution (lower()), but I think it’s worth looking at a few homemade solutions first. For instance, we could try ...
Read More »How to Round a Number in Python: Truncation, Arithmetic, and More
Remember learning to round in grade school? Me too! The only problem is I don’t use the idea very often. As a result, I don’t always remember how to round a number in programming contexts like Python. Luckily, I’ve pieced together a little article for myself. Hopefully, you get some value out of it as well. As it turns out, ...
Read More »How to Create a List in Python: Loops, Comprehensions, and More
If you’re working with Python for the first time, you might be interested in learning how to store data. For example, you might want to collect a list of exam scores, so you can average them. If so, the list data structure gets the job done. But, how do you create a list in Python? That’s the topic of today’s ...
Read More »How to Compute Absolute Value in Python: Control Flow, Abs(), and More
As Python is increasingly used for computation, it becomes more important for math related resources to be made available. To aid in that effort, I figured I’d share a few ways to compute absolute value in Python. As it turns out, there are a few ways to compute absolute value in Python. First, there’s the abs() function which comes built ...
Read More »