Last active
June 29, 2016 22:11
-
-
Save jmwenda/7805eacb21df64340a869beda6af895c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box[box.find("(")+1:box.find(")")] | |
>>> box = 'BOX(-71.1608660012332 42.3537910000038,-71.1237350012334 42.3727380000039)' | |
>>> print box | |
BOX(-71.1608660012332 42.3537910000038,-71.1237350012334 42.3727380000039) | |
>>> print box[s.find("(")+1:box.find(")")] | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
NameError: name 's' is not defined | |
>>> print box[box.find("(")+1:box.find(")")] | |
-71.1608660012332 42.3537910000038,-71.1237350012334 42.3727380000039 | |
>>> box = box[box.find("(")+1:box.find(")")] | |
>>> print box | |
-71.1608660012332 42.3537910000038,-71.1237350012334 42.3727380000039 | |
>>> box_list = [x.strip() for x in box.split(',')] | |
>>> print box_list | |
['-71.1608660012332 42.3537910000038', '-71.1237350012334 42.3727380000039'] | |
>>> minvalues = [x.strip() for x in box.split(' ')] | |
>>> print minvalues | |
['-71.1608660012332', '42.3537910000038,-71.1237350012334', '42.3727380000039'] | |
>>> print box_list | |
['-71.1608660012332 42.3537910000038', '-71.1237350012334 42.3727380000039'] | |
>>> minvalues = [x.strip() for x in box_list[0].split(' ')] | |
>>> print minvalues | |
['-71.1608660012332', '42.3537910000038'] | |
>>> maxvalues = [x.strip() for x in box_list[1].split(' ')] | |
>>> print maxvalues | |
['-71.1237350012334', '42.3727380000039'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment