I am currently using python 3.5 and Ubuntu 16.04. I have a code in python 2 and i want to use it for python 3.5. The code consists of lambda and the argument passed to it (lets say apple) consists of 3 tuples. 1st tuple is an array which looks like something this:
array([[0,0,0,0],[0,0,0,0]],dtype=uint8)
2nd tuple consists of a pair of number like this:
(34,678)
3rd tuple is a string and it consists of a path which points to a particular file:
'/home/king/abcd.png'
Therefore my argument apple looks like this:
apple=(array([[0,0,0,0],[0,0,0,0]],dtype=uint8),(34,678),'/home/king/abcd.png')
Now i know the syntax has changed in python3 for lambda along with removal of tuple parameter unpacking:
lambda(x, y) : x*x , y*y (python2)
lambda x_y : x_y[0] * x_y[0] , x_y[1] * x_y[1] (python3)
Now my main question/problem is I want to access the first row of the 1st tuple inside lambda i.e access:
[[0,0,0,0],[0,0,0,0]]
The parameter passed to lambda is our argument apple. My current syntax is:
lambda(x,y,z) : x[0] , y , z (pyhton2)
lambda x_y_z : ? , ? , ? (python3)
Note: I am not using/trying/thinking of using python 3.8