G
Guy Robinson
Hello,
Trying to change a string(x,y values) such as :
s = "114320,69808 114272,69920 113568,71600 113328,72272"
into (x,-y):
out = "114320,-69808 114272,-69920 113568,-71600 113328,-72272"
I tried this:
print [(a[0],-a[1] for a in x.split(',')) for x in e]
But it doesn't work. Can anyone suggest why or suggest an alternative
way? The text strings are significantly bigger than this so performance
is important.
TIA,
Guy
Trying to change a string(x,y values) such as :
s = "114320,69808 114272,69920 113568,71600 113328,72272"
into (x,-y):
out = "114320,-69808 114272,-69920 113568,-71600 113328,-72272"
I tried this:
print [(a[0],-a[1] for a in x.split(',')) for x in e]
But it doesn't work. Can anyone suggest why or suggest an alternative
way? The text strings are significantly bigger than this so performance
is important.
TIA,
Guy