Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime and Region #13

Open
j-zhang opened this issue Oct 19, 2013 · 3 comments
Open

Datetime and Region #13

j-zhang opened this issue Oct 19, 2013 · 3 comments

Comments

@j-zhang
Copy link

j-zhang commented Oct 19, 2013

From the data feed I am using, the datetime and region variables don't completely match in format to the one from the older feed based on the text file. Do we need to change the datetime format and also remove the distance and direction info from the region variable?

i.e.
1382220868060 and 92km E of Ciudad Constitucion, Mexico

@sunnymh
Copy link

sunnymh commented Oct 20, 2013

In Python, there is a package time. You can do:
import time
dayTime = time.strftime('%A, %B %d, %Y %H:%M:%S UTC', time.gmtime([time in time col]/1000))
to get the same format, though I'm not sure if it is required or not.
Documentation: http://docs.python.org/2/library/time.html

For region, I used regular expression to parse it into three columns, but I'm not sure what we are supposed to do either.

@j-zhang
Copy link
Author

j-zhang commented Oct 20, 2013

I also looked at the datetime module, http://docs.python.org/2/library/datetime.html, which is similar to the one you mentioned.

I think it would probably help make the output look more similar and easier to read, but in our visualization, the most important data seem to be latitude, longitude and magnitude, so we might not need to change the datetime and region variables.

@aculich
Copy link
Member

aculich commented Oct 21, 2013

The date & time are not required to be used in this assignment, however you are welcome to use the extra data to generate a more interesting visualization if you want to.

The format of 1382220868060 is represented as the number of seconds from the Unix Epoch

@sunnymh and @j-zhang have good suggestions for handling the conversion of this representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants