Sign in

Economics and Data Science student. Obsessed about automation and data analytics.

The family office with a $50bn bet with wall street

March 25th, 2021 — The stock of ViacomCBS, a traditional and popular U.S.-based multimedia company, had free fallen from U$100.34 to U$66.35 in only three days (see chart below). The stock had been highly popular with investors in the months prior, nearly doubling its price. The market was left confused and desperate: the blue-chip stock was crashing without any apparent reason. At the same time, seven other completely unrelated stocks seemed to be suffering from the same condition: Tencent Music, Baidu, Vipshop, Farfetch, iQIYI, Discovery, and GSX Techedu. …


How to go from the world’s poorest to the world’s fastest-growing economies

In the middle of the 1947 heat-wave, Seretse Khama, the Prince of Bechuanaland (colonial Botswana) and heir to the throne, met the English Lloyd’s clerk Ruth Williams at a London ball. The Prince was smitten — after only a year of courtship, the Prince and the English clerk got hitched. However, what came after their union was everything but a fairytale.

At the time, Bechuanaland was one of the poorest territories in the world. Having recently implemented racist apartheid laws banning interracial marriages, the much more powerful neighboring South Africa took the union between the Prince and a white woman…


Tables, Relationships, Diagrams…

If you have an exam tomorrow, or an important interview, or maybe you want to gain a general understanding of SQL before learning it formally, welcome to my (quick) practical summary!

Structurally, there are Clusters → Catalogues → Schemas → Tables and Views → Columns and Rows, in that order of hierarchy. Schemas and Tables are the most important to understand — in schemas, you can create a database where you will store your data in different tables (equivalent to a pythonic data frame). You can create the database, or use an existing one:

CREATE NewDatabase;USE ExistingDatabase;

In SQL…


Comparing two sklearn hyperparameter tuning tools…

Hyperparameter tuning is a powerful tool to enhance your supervised learning models— improving accuracy, precision, and other important metrics by searching the optimal model parameters based on different scoring methods. There are two main options available from sklearn: GridSearchCV and RandomSearchCV. I will go through each one of them quickly and then do a full comparison of the two methods!

Since this is Python-based tutorial, enjoy this amazing close-up of a real Python:

GridSearchCV

GridSearchCV implements the most obvious way of finding an optimal value for anything — it simply tries all the possible values (that you pass) one at a…


These simples techniques can save your project a lot of time from revisions and data loss

Having been working with Jupyter almost daily for the past three years, I have experienced serious undesired situations that took me back days, or even weeks in my project completion time. These are simple things that I have learned to do to prevent serious data loss, time loss, and project phase confusion.

Save copies of your dataset — especially if they are large, time-consuming imports.

If you have a 75MB file that takes 10–15 minutes to import to your working Jupyter Lab or Notebook, make sure to save it as a copy as soon as the import is done:

import pandas as pdreally_large_file = pd.read_excel('largefile.xlsx')copy = really_large_file.copy()

You can then choose…


The Only Model The Pandemic Hasn’t Broken?

European vs. American Options

There are two types of vanilla financial options that are traded in the financial markets: American — where you can exercise the option any time until the exercise date — and European — where you have to wait until the exercise date to exercise the option.

The names “American” and “European” don’t actually relate to where the option is traded, or what nationality the company is. …


Visualising How Machine Learning Makes Decisions and Predictions.

How can machine-learning algorithms understand complex relationships between variables that not even field experts sometimes fully understand? In my article, Machine Learning and Real State, I collected data from real state listings in Amsterdam to understand how rent prices are determined in this (very overpriced) city.

After all the transformations, my dataset ended up with a staggering 327 columns and almost 4,000 rows. It would be near impossible for a human to look at all this data and try to understand what is happening in the real state market. …


Travel has stopped, and with it, Airbnb bookings. 68% of Airbnbs have zero bookings until August, and the average host has already lost €14K — Can Airbnb as we know it survive?

Amsterdam has a troubled history with Airbnb. The city has been lacking affordable housing for years and also just housing, in general. The Dutch capital is tiny, constricted by water, and struggling with crippling building regulations. This drives up rental prices in the private market, which reaches on average two-thirds of amsterdammers’ monthly income. The arrival of Airbnb took up rental listings out of the local market, but also provided a life-line for many Amsterdammers struggling to meet their rent obligations. …


Here is a more intuitive way of understanding Python functions.

What are functions?

We first learn about functions in high school mathematics. The general concept of functions in maths is that there is an input (let’s call it x) and an output (let’s call it y). We represent a mathematical function like this:

y = f(x)

where f(x) can be any transformation (such as adding, subtracting, multiplication, exponentials…) to the input we call x. One example could be:

y = 2x + 1

where the f represents the equation where we will take the output, multiply it by two and add one, and most importantly, we want to return it as y.

Why…


Sometimes my code needs to be used by people that have never seen a command line. Here’s how to make their lives (and yours) easier.

If you are not a software engineer, you may work with people that don’t know any programming. However, your Python solutions can increase the team’s efficiency and reduce workload tenfold. But what if you need to teach others how to execute it too? Using the terminal or other user interfaces may look too foreign and complicated for many.

In this tutorial, I will go through the process of creating a GUI for your Python script. We will use the Python package Gooey, which will make it extremely easy to design beautiful and simple user interfaces that look familiar to anyone…

Brunna Villar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store