LoginSignup
2
1

More than 3 years have passed since last update.

30 mins intro to Q/KDB+ via Python (Part 1)

Last updated at Posted at 2019-06-10

Goal of the blog

The goal is to introduce a programming skill, Q/KDB+, that is widely used in the financial sector, among others, and to get a glimpse into the power of vector processing concepts. The latter can help one write efficient code, especially when there is need to manipulate/aggregate mass amount of data, like in machine learning.

The blog does not judge if the programming language is worth learning or if it's superior than others. I'll leave the judgment to the reader.

Layout of the blog

The blog targets readers with basic programming knowledge (string, array, loop, arithmetic operations). I'll use Python as the starter to illustrate the programming concepts, and then replicate the code in Q for the reader to relate, compare and deepen understanding.

The code demonstrated here attempts to implement a simple linear regression machine learning model, but I won't go into the details. It is merely to add some flavor to the blog.

Takeaway

At the end of the blog, I hope the reader will get

  • A good feel of Q/KDB+
  • A good feel of the power of vector processing
  • References for readers who decide to pursue further

Topics covered

  • Data types, like date, boolean and their arithmetic operations
  • Data structures, like list, table and their manipulation, Q-SQL
  • Lambda, vector processing

So, what's Q/KDB+?

KDB+ is a column based, in-memory database. While it's named DB, one can think of it like an internal cache of a C process designed to hold 2-dimensional data (ie table), powered with a SQL-like query capability. Read this Wikipedia for more info.

Q, on the other hand, is a scripting language that can be used to build those KDB+ databases, or other sort of programs like pub/sub engine, batch processes etc. Read this Wikipedia more info.

Let's get started

Part 2

Disclaimer

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1