= map(lambda element: element[1], read_csv) FRR = map(lambda element: element[2], read_csv) FAR
why is this so ugly
Use operator.itemgetter(1)
, thats what it is for. Also a list comprehension is nicer usually.
make an example out of my code pls
= map(operator.itemgetter(1), read_csv) FRR
But then also
= [ element[1] for element in read_csv ] FRR
But then also
= zip(*[ (element[1], element[2]) for element in read_csv ]) FRR, FAR
idk Ive never seen a zip(* [ before
*
is a splat. It unrolls an iterable into arguments.