stat157 / recent-quakes

Stat 157 Homework 2 due on Monday 2013-10-21 at 11:59pm
0 stars 20 forks source link

Datetime and Region #13

Open j-zhang opened 10 years ago

j-zhang commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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.