to all, I was doing some searches on the use of list comprehension syntax. I would like to see if it's possible to return 2 lists from 2 existing lists with 1 line of code i.e using list comprehension. I came across this post Possible to return two lists from a list comprehension? which make me think it's possible. Creating the new lists independently works fine I would like to see how far I can take it i.e minimal code but still easily readable
Consider the following I have 2 pre-existing lists wnv and wdv and would like to create 2 new lists Av and Bv as follows;
Av,Bv=[(zeta*wn*dt,wd*dt) for i,(wn,wd) in zip(wnv,wdv)]
where zeta and dt are just a numbers Can this be done? With the above code, I am getting the error: unpack non-iterable float object