Message Boards Message Boards

0
|
2238 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Use Select function in Dataset?

Posted 6 years ago

I have a list of earthquakes taken from Wolfram repository.

data = Reverse[Sort[ResourceData["Sample Data: US Earthquakes"]]]

I need to write two functions: the first one selects all earthquakes which have a magnitude of 6.0 to 8.0. Second selects all earthquakes which occurred from 2015 to 1995. Is there any way do that with "Select" function?

POSTED BY: Artem Anisimov
2 Replies

This is a way:

dst = ResourceData["Sample Data: US Earthquakes"]
dst[Select[6.0 <= #Magnitude <= 8.0 &]]
dst[Select[
  DateObject[{1995, 1, 1}] <= #Date <= DateObject[{2015, 12, 31}] &]]
POSTED BY: Gianluca Gorni
Posted 6 years ago

Thank you.

POSTED BY: Artem Anisimov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract