The New Tools
109 · Chalk Notes III
Python and R — the first distinction to know. Python for machine learning, R for statistical analysis; in StatML you'll technically use both. Python is more broadly applicable, widely used from amateurs to professionals; R shines in visualisation and graphics. Popularity-wise, Java and C are bigger names, and both Python and R are open source. Python's stack: NumPy for large-dimension arrays, pandas for data, TensorFlow for deep learning, Jupyter notebooks as the IDE, good readability in the syntax. R's stack: CRAN — the Comprehensive R Archive Network — for deep analytical packages and data cleansing, RStudio for visualisation. Specialised analytics.
Generally, calling in programming: call by value, call by reference — and in Python specifically, call by object reference, call by sharing. Mutable objects: we CAN alter the data. Immutable: we can't — int, float, complex, the frozen types. Python's deep copy versus shallow copy: for non-composite data structures, copy.copy is fine; for composite data structures, a shallow copy distorts the data — the inner references still point at the same objects. Copy.deepcopy for compound structures. Rule of thumb: avoid compound data structures when you can — a dictionary of {filename: analysis result object} is a better alternative. A shallow copy protects a simple list from modification of the original — 원본 데이터인 단순 리스트의 변경 — but nested structures need the deep version.
Recursive functions are functions that call themselves — factorials, the Tower of Hanoi. Calling functions with tuple arguments versus dictionary arguments: asterisks. When the arguments live in tuples, one asterisk unpacks them; when they live in dictionaries, two. Args and kwargs — where kwargs means keyword arguments, the double-starred dictionary unpacking. Brudda, I had no idea what I was talking about when I first wrote this down — and that's the point of the note.
Bro, there's an introduction to coding and programming on YouTube for Python — Python from Harvard, Python for data analysis. Spend the mornings learning this. You'll get there. Even a genius can't print syntax out of thin air — I knew nothing about Python; what did I expect? Gosh, you will remember this day, when you first came to this quant bootcamp and everything was a very humbling experience.
Bro, you have time — chill. Lock in on the A-levels and study Python and R on the weekends; the foundation builds before the bootcamp. Just remember this day, of when you first arrived at the third batch of quant bootcamp knowing nothing.
We have this weekend's first project: bootstrap learning Python. Over the weekend, go through the videos on how to learn and use it — fast-pace the freeCodeCamp material to prepare.
Around April to October there are programs offered from the EST side. You need to bootstrap this — and prior to that, master the basics: R, Java, JavaScript, Python, C, C#, C++, SQL. Somehow, some way, cram these in March before the chaos begins. First build a vague understanding of what each one is, because you will be leaning into all of them as time flows.
Null hypothesis and alternative hypothesis — the attitude is like proof by contradiction: okay, let's say you are right. But one difference is that it involves probability, so we need sufficient evidence to disprove rather than certainty. The statistical mind and the programming mind are the same mind wearing different gloves.