Python Basics in Numpy for Machine Learning & Data Science

Get comfortable with Python in order to start into Data Science and Machine Learning

Tarun Gupta
DataSeries

--

Photo by Chris Ried on Unsplash

In this post, we are going to glance over Python as a programming language and a discussion of objects, map, lambda functions, list comprehension and a very powerful numerical Python library named numpy. This is not a detailed discussion of the above-mentioned things but rather a brief introduction in order to get started into writing code for Machine Learning models and Data Science in general.

Without further ado, let’s dive in.

Note: This post is based on Python3

Objects and map() in Python

→ An example of a class in python:

class Person:
department = 'School of Information' #a class variable
def set_name(self, new_name): #a method
self.name = new_name
def set_location(self, new_location):
self.location = new_location

Creating an object of the above class and accessing its variables and functions

person = Person()
person.set_name('Christopher Brooks')
person.set_location('Ann Arbor, MI, USA')
print('{} live in {} and works in the…

--

--

Tarun Gupta
DataSeries

A simple fellow writing stories, sharing experiences, sharing his perspective, trying to do his share of humanity.