Case study

We will use the data from the world bank. It contains data on world economies for over half a century. The indicators are : Population Electricity consumption CO2 emissions Literacy rates Unemployment Mortality rates Dictionaries for data science+ Writing a function to help you Using a list comprehension Turning this Read more…

List comprehensions

Populate a list with a for loop : We can do that in only one line with a list comprehension ! Now a list comprehension with range() : List comprehensions : Collapse for loops for building lists into a single line Components : iterable iterator variable (represent members of iterable) Read more…

Lambda functions

There is a quicker way to write functions: lambdas ! So basically you specify the variables in input, and then the operation which is performed et.. voila ! You can also write anonymous functions : Function map takes two arguments: map(func, seq) map() applies the function to ALL elements in Read more…

Loops

Now if we want to repeat things we can use a wide variety of tools. Like : While loops Repeating action until condition is met Do not forget to increment the condition to avoid being stuck in an infinite loop. If your are just ctrl+c to stop the calculation For Read more…

Matplotlib

Matplotlib is used to…Plot your data into nice histograms and graphs. As you can imagine it is pretty important for Data scientists as it is used to get a visual of your data, explore it and get insights. Scatter plot How to put the x-axis on a logarithmic scale : Read more…

Introduction to Python

Python Basics You can execute commands in Python Shell -> line by line You can also create Python scripts in text files with extension .py You can create variables, do operations and then print() to generate output from script : What is a variable : Specific, case-sensitive name, Call up Read more…