you don't need zip at all
you will need zip if you have 2 list and want to combine them:
#Structure of array (Stored in float), with structure like this [Room, Price] array = [[4.0, 399.9], [5.0, 329.9], [6.0, 369.0]] #Set initial value theta_price = 0 theta_room = 0 stepsize = 0.01 item = 3 #Perform iterations for looping in range(0, 50): #Loop 50 times theta_price = theta_price - stepsize * (1 / item) * sum([theta_price + theta_room * int(j) - int(k) for j, k in array])#Perform iterations of theta 0 theta_room = theta_room - stepsize * (1 / item) * sum([(theta_price + theta_room * int(j) - int(k)) * int(j) for j, k in array])#Perform iterations of theta 1 print(theta_price,theta_room)#Print the result for every loop
you will need zip if you have 2 list and want to combine them:
>>> list1 = [1,2,3] >>> list2 = [3,4,5] >>> zip(list1,list2) [(1, 3), (2, 4), (3, 5)]