Design a site like this with
Get started


Some interesting things I did the last few days:

List Comprehensions

The function below can be written with a single line of code:

ints = [1, 2, 3, 4]

times_ten = []

for i in ints:

times_ten.append(i * 10)


[10, 20, 30, 40]

It can be written like this:

times_ten = [(i * 10) for i in ints]

So on order to transform a loop to a list comprehension, in brackets we:

  • Start with the code that transforms each item.
  • Continue with our for statement (without a colon).

Lambda functions

To create a lambda function (temporary) equivalent of another function, we:

  • Use the lambda keyword, followed by
  • The parameter and a colon, and then
  • The transformation we wish to perform on our argument

I also refreshed my memory on some statistics topics :

There are four different scales of measurement: nominal, ordinal, interval, and ratio. The characteristics of each scale, pivot around three main questions:

  • Can we tell whether two individuals are different?
  • Can we tell the direction of the difference?
  • Can we tell the size of the difference?

What sets apart ratio scales from interval scales is the nature of the zero point.

And finally, I did some handling of missing values:

The technical name for filling in a missing value with a replacement value is called imputation.

Here are some pages that contain interesting data for analysis

And especially this has a ton of data from Greece. Really interesting!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: