# Month: July 2018

## How to Calculate the Standard Deviation of a Numpy Array?

Daily Data Science Puzzle [python] import numpy as np temp_sensor = np.array( [ 18, 22, 22, 18 ]) mean = np.mean(temp_sensor) std = np.std(temp_sensor) print(str(int(mean – std)) + "-" + str(int(mean + std))) [/python] What is the output of this puzzle? *Intermediate Level* (solution below) Numpy is a popular Python library for data science for …

## How to Calculate the Standard Deviation in Numpy?

Daily Data Science Puzzle [python] import numpy as np # daily stock prices # [open, close] google = np.array( [[1239, 1258], # day 1 [1262, 1248], # day 2 [1181, 1205]]) # day 3 # standard deviation y = np.std(google, axis=1) print(y == max(y)) [/python] What is the output of this puzzle? *Advanced Level* (solution …

## [2-min CS Concepts] A Rapid Introduction to the PubSub Communication Pattern

Did you check the news today? Or receive an email newsletter from a company? This type of communication is one way. Information flows from a publisher to the subscribers. The publisher creates information, the subscriber consumes information. Thus, computer scientists call this communication pattern publish and subscribe paradigm – pubsub. When consuming news, you seek …

## A Case for Puzzle-based Learning Python

Overcome the Knowledge Gap The great teacher Sokrates delivered complex knowledge by asking a sequence of questions. Each question was building on answers to previous questions provided by the student. This more than 2400 year old teaching technique is still in wide-spread use today. A good teacher opens a gap between their’s and the learner’s …

## [2-min CS Concepts] A Rapid Introduction to Decision Trees for Machine Learning

Deep learning has become the megatrend within artificial intelligence and machine learning. Yet, training large neural networks is not always the best choice. It’s the bazooka in machine learning, effective but not efficient. A human will not understand in practice why the neural network classifies one way or the other. It is just a black …

## How to index 1D numpy arrays?

Daily Data Science Puzzle [python] import numpy as np # The fibonacci series F = np.array([0, 1, 1, 2, 3, 5, 8]) F[::3] = 0 print(sum(F[:4])) [/python] What is the output of this puzzle? *Intermediate Level* Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. This puzzle demonstrates indexing …

## 29+ Killer Resources on How to Learn Python [Overview Article]

Python is one of the most popular programming language according to a recent Spectrum article. But why should you decide to enter the game as well and invest your scarce time in learning Python? For three reasons: Python developers are among the highest paid across all programming languages: on average you can expect to bring …

## [2-min CS Papers] A Short Overview of the Apache Spark System

Large companies analyze massive amounts of data coming from various sources such as social nets, weblogs, or customers. An important class of data analytics concerns large-scale set operations. Suppose you have two customer data sets A and B. Set A contains all customers who bought in 2017. Set B contains all customers who bought in …

## [Numpy * Operator] Element-wise Multiplication in Python

How does element-wise multiplication of two numpy arrays a and b work in Python’s Numpy library? Simply use the star operator “a * b”! Here is a code example from my new NumPy book “Coffee Break NumPy”: Can you guess the output of this puzzle?*Advanced Level* (see solution below) NumPy is a popular Python library …