21-09-2020

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)

print(times_ten)

[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

https://www.reddit.com/r/datasets/

https://github.com/awesomedata/awesome-public-datasets

https://rs.io/100-interesting-data-sets-for-statistics/

And especially this http://www.data.gov.gr/ has a ton of data from Greece. Really interesting!

Leave a comment

Design a site like this with WordPress.com
Get started