Posts

Showing posts from March, 2018

Python Numpy Tutorial #2

Image
In our last tutorial, we talked about numpy arrays. If you have not read it, visit  here.   In this post, we will deeper into numpy and talk a bit about the various tools it provides us.  At first, we will see how arithmetic operations work in numpy arrays and the numpy universal functions, ending this tutorial with broadcasting. Array Maths: Basic element-wise addition, subtraction, multiplication, and division can be done in this way : import numpy as np x = np . array([[ 1 , 2 ],[ 3 , 4 ]]) y = np . array([[ 5 , 6 ],[ 7 , 8 ]]) print (x + y) #element-wise addition print (x - y) #element wise subtraction print (x * y) #element-wise multiplication print (x / y) #element-wise division #For all these operations, the first operand will be from x and the second operand from y The output will be an array of the operation on the two vectors. The dot product of two matrices can be calculated in the following way: import numpy as np x ...

Python Numpy Tutorial #1

Image
Numpy is the major library for scientific computing in Python.NumPy enriches the programming language Python with powerful data structures for efficient computation of multi-dimensional arrays and matrices. If you are familiar with Octave or Matlab, you will find this tutorial easy. NB: Numpy can be imported using import numpy as np  Arrays : You can create an array as follows: a = np . array([ 1 , 2 , 3 , 4 ]) #creates a 1x 4 array b = np . array([[ 1 , 2 , 3 ],[ 1 , 2 , 3 ]]) #creates 2x3 array Along with the array, some important parameters taken by np.array ()  are:    1. dtype: It helps you to pass the desired datatype of the array. The       permitted  datatypes are -> int8, int16, int32, int64, float16, float32, float64, complex64 and complex128. Int is for integers, float can store real numbers and complex can store complex numbers. The number represents the bit of data stored...

Open Source Licences

Image
Many of you have heard about open source software. You might have also heard about the open source platform Github. When I first uploaded code on Github, I chose a license randomly. I thought of what use a open source licence might have, but i was wrong. When one builds such a tool or product, that can be forked by others to build their own versions by tweaking and changing its source code, one needs to decide an open source license for it. Today I am going to talk about the various open source licences. What is a LICENSE? Licenses provide rules and guidelines for others to use your work. Open source licenses help others to contribute to your work or project without seeking special individual permission to do so. The different open source licencses There are numerous licenses . I will list out the most commonly used Licenses. All these licenses are OSI (Open Source Initiative ) approved licenses, except the last one. 1. Apache License 2.0 : It is one of the most popular...