Skip to main content

Posts

Basic of Python

1. What is _init_ in python? it's an init() method in every call defined in Python.. to initialize like constructor like in java. class Employee: def __init__(self, name, age,salary):     //self is an instance or an object of a class. In Python, this is explicitly included as the first parameter. self.name = name self.age = age self.salary = 20000 E1 = Employee("XYZ", 23, 20000) # E1 is the instance of class Employee. #__init__ allocates memory for E1.  print(E1.name) print(E1.age) print(E1.salary) ----------------------------------------------------------------------------------------- 2. Lambda function a = lambda x,y : x+y print(a(5, 6)) b = lambda x,y,z : (x+z)/y print(b(9,3,6)) ----------------------------------------------------------------------------------------- 3. What does [::-1] do? A. It reverse's the array. import array as arr My_Array=arr.array('i',[1,2,3,4,5]) My_Array[::-1] Output: array(‘i’, [5, 4, 3, 2, ...

Machine Learning - Terms

Machine Learning Age on Network ['aon'] ['total_rech_amt_6', 'total_rech_amt_7','total_rech_amt_8'] Average Data Recharge Amount ['av_rech_amt_data_6 ','av_rech_amt_data_7','av_rech_amt_data_8'] Average Revenue Per User ['arpu_6' , 'arpu_7' , 'arpu_8'] Maximum Recharge Amount ['max_rech_amt_6','max_rech_amt_7','max_rech_amt_8'] Last day recharge amount [ 'last_day_rch_amt_6' , 'last_day_rch_amt_7' , 'last_day_rch_amt_8'] Total Number of Recharges [ 'total_rech_num_6' , 'total_rech_num_7' , 'total_rech_num_8'] Maximum data recharges [ 'max_rech_data_6' , 'max_rech_data_7' , 'max_rech_data_8'] 2G volume [ 'vol_2g_mb_6' , 'vol_2g_mb_7' , 'vol_2g_mb_8'] Monthly 2G [ 'monthly_2g_6' , 'monthly_2g_7' , 'monthly_2g_8'] 3G volume [...

Python Programming Basics

Python is one of the powerful languages which has picked up the popularity after Machine Learning and Artificial Intelligence has boomed. I don't want to highlight on the why Python but how Python can be used. Here are the list of contents 1. Installation 2. Libraries 3. Data Structures 4. Loops 5. Exercises 1. Installation You get Python from Anaconda :) Download Anaconda  for your respective environments and install Launch Anaconda Navigator and you will see few options like Jupyter notebook, spyder, orange, rstudio etc. launch Jupyter notebook for python. Jupiter notebook will launch on your default browser and select the "New" -> "Python 3" option. A new tab will be opened with option to play with python. Click on the Untitled and rename appropriately as per your exercise/chapter. That's it we are all set for to get our hands dirty.. Let's jump into programming. 2. Libraries             For the basic program...