## [2-min Computer Science Papers] A Short Introduction into the MapReduce System

Google processes huge data sets. For example, the search engine needs to know how often words occur in web documents. The data sets are too large for a single computer. As a single computer has only eight CPUs, processing the data takes forever. Hence, Google uses hundreds of computers in parallel. But writing parallel programs …

## [2-min Computer Science Concepts] What are Arrays?

Do you know the matrix movie? A matrix is a data structure that holds a bunch of data items of the same type. For example, a matrix of integers holds a set of numbers.   An array is the exact same thing as a matrix. In fact, a matrix is nothing but an array, or …

## Is This an Average Puzzle? Yes!

Daily Data Science Puzzle [python] import numpy as np # Goals in five matches goals_brazil = np.array( [1,2,3,1,2]) goals_germany = np.array( [1,0,1,2,0]) br = np.average(goals_brazil) ge = np.average(goals_germany) print(br>ge) [/python] What is the output of this puzzle? *Beginner Level* Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. This …

## NumPy Matrix Multiplication — np.matmul() and @ [Ultimate Guide]

Have you ever tried to multiply two NumPy arrays together and got a result you didn’t expect? NumPy’s multiplication functions can be confusing. In this article, we’ll explain everything you need to know about matrix multiplication in NumPy. Watch the video where I go over the article in detail: To perform matrix multiplication between 2 …

## How to Multiply 2D Matrices in Numpy?

Daily Data Science Puzzle [python] import numpy as np # graphics data a = [[1, 1], [1, 0]] # stretch vectors b = [[2, 0], [0, 2]] c = np.matmul(a, b) print(c[0,1]) [/python] What is the output of this puzzle? Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. …

## The Dot Product in Numpy

Daily Data Science Puzzle [python] import numpy as np # simple regression model W = np.array([0.7, 0.2, 0.1]) # Google stock prices (in US-\$) # [today, yesterday, 2 days ago] x = np.array([1131, 1142, 1140]) # prediction y = np.dot(W, x) # do we expect growing prices? if y > x[0]: print("buy") else: print("sell") [/python] …

## Who Dominates Instagram or Comparing Each Element of a Numpy Array

Daily Data Science Puzzle [python] import numpy as np # popular instagram accounts # (millions followers) inst = [232, #"@instagram" 133, #"@selenagomez" 59, #"@victoriassecret" 120, #"@cristiano" 111, #"@beyonce" 76] #"@nike" inst = np.array(inst) superstars = inst > 100 print(superstars[0]) print(superstars[2]) [/python] What is the output of this puzzle? Numpy is a popular Python library for …

## Analyzing Stock Data with Numpy – The Reshape and Average Functions

Daily Data Science Puzzle [python] import numpy as np # apple stock prices (May 2018) prices = [ 189, 186, 186, 188, 187, 188, 188, 186, 188, 188, 187, 186 ] prices = np.array(prices) data_3day = prices.reshape(4,3) print(int(np.average(data_3day[0]))) print(int(np.average(data_3day[-1]))) [/python] What is the output of this puzzle? Numpy is a popular Python library for data …

## How to Create a Sequence of Evenly Spaced Values with Numpy Linspace?

Daily Data Science Puzzle [python] import numpy as np year = np.linspace(0, 365, 366) print(int(year[-1] – year[-2])) [/python] What is the output of this puzzle? Numpy is a popular Python library for data science focusing on linear algebra. This puzzle is about the useful function linspace. In particular, linspace(start, stop, num) returns evenly spaced numbers …

## How to Create a Sequence of Linearly Increasing Values with Numpy Arange?

Daily Data Science Puzzle [python] import numpy as np # save \$122.50 per month x = 122.5 net_wealth = np.arange(0, 1000, x) # how long to save >\$1000? print(len(net_wealth)) [/python] What is the output of this puzzle? Numpy is a popular Python library for data science focusing on linear algebra. This puzzle is about the …

## How to Initialize a Numpy Array with Zeros and Ones

Daily Data Science Puzzle [python] import numpy as np n = 100 # dimensionality W = np.zeros((n,n)) for i in range(len(W)): W[i][i] = 2 X = np.ones((n,n)) Y = W * X print(int(Y[-1][-1])) [/python] What is the output of this puzzle? Numpy is a popular Python library for data science focusing on linear algebra. When …

## Numpy Matrix Multiplication

Daily Data Science Puzzle [python] import numpy as np # salary in (\$1000) [2015, 2016, 2017] dataScientist = [130, 132, 137] productManager = [127, 140, 145] designer = [118, 118, 127] softwareEngineer = [129, 131, 137] A = np.array([dataScientist, productManager, designer, softwareEngineer]) # salary raise for data scientists B = np.ones((4,1)) B[0] = 1.1 C …