Skip to content

Instantly share code, notes, and snippets.

@chrisa
Created July 17, 2013 15:31
Show Gist options
  • Select an option

  • Save chrisa/6021679 to your computer and use it in GitHub Desktop.

Select an option

Save chrisa/6021679 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p320 :014 > data = [[0.0, 1374073120], [0.0, 1374073130], [0.0, 1374073140], [0.0, 1374073150], [0.0, 1374073160], [0.0, 1374073170], [0.0, 1374073180], [0.0, 1374073190], [0.0, 1374073200], [0.0, 1374073210], [0.0, 1374073220], [0.0, 1374073230], [0.0, 1374073240], [0.0, 1374073250], [0.0, 1374073260], [0.0, 1374073270], [0.0, 1374073280], [0.0, 1374073290], [0.0, 1374073300], [0.0, 1374073310], [0.0, 1374073320], [0.0, 1374073330], [0.0, 1374073340], [0.0, 1374073350], [0.0, 1374073360], [0.0, 1374073370], [0.0, 1374073380], [0.0, 1374073390], [0.0, 1374073400], [nil, 1374073410], [100.0, 1374073420]]
=> [[0.0, 1374073120], [0.0, 1374073130], [0.0, 1374073140], [0.0, 1374073150], [0.0, 1374073160], [0.0, 1374073170], [0.0, 1374073180], [0.0, 1374073190], [0.0, 1374073200], [0.0, 1374073210], [0.0, 1374073220], [0.0, 1374073230], [0.0, 1374073240], [0.0, 1374073250], [0.0, 1374073260], [0.0, 1374073270], [0.0, 1374073280], [0.0, 1374073290], [0.0, 1374073300], [0.0, 1374073310], [0.0, 1374073320], [0.0, 1374073330], [0.0, 1374073340], [0.0, 1374073350], [0.0, 1374073360], [0.0, 1374073370], [0.0, 1374073380], [0.0, 1374073390], [0.0, 1374073400], [nil, 1374073410], [100.0, 1374073420]]
ruby-1.9.2-p320 :015 > data.reject { |d| d[0].nil? || (0..1).include?(d[0]) } => [[100.0, 1374073420]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment