Course Solutions Uncategorized (Solved) : Day Centerlat Centerlon Fcount2015 04 10 427 738 12015 04 21 427 738 192015 05 10 427 738 Q32989512 . . . .

(Solved) : Day Centerlat Centerlon Fcount2015 04 10 427 738 12015 04 21 427 738 192015 05 10 427 738 Q32989512 . . . .

 

DAY,CENTERLAT,CENTERLON,FCOUNT2015-04-10,42.7,-73.8,12015-04-21,42.7,-73.8,192015-05-10,42.7,-73.8,12015-05-27,42.7,-73.8,72015-05-30,42.7,-73.8,72015-06-09,42.7,-73.8,992015-06-12,42.7,-73.8,342015-06-13,42.7,-73.8,2762015-06-23,42.7,-73.8,52015-07-19,42.7,-73.8,1102015-08-03,42.7,-73.8,622015-08-04,42.7,-73.8,32015-08-11,42.7,-73.8,32015-08-15,42.7,-73.8,452015-09-03,42.7,-73.8,102

PLEASE USE PYTHON

Lists and Files

I have gathered together some interesting data into a filecalled UAlbanyLightning.txt

The file contains all recorded lightning strikes in the UAlbanyarea

Parsing

Review alist =str.split()            # alist will contain the elements of str – split usingwhitespace

Specifying a delimiter

Examples: delimiter = ‘,’ delimiter = ‘-‘, delimiter = ‘;’

Stripping specified characters

Example: astring.strip(‘n’)

Avoid blank lines: if len(line) == 0:

                                   continue

Splitting on commas

DAY,CENTERLAT,CENTERLON,FCOUNT

2014-06-09,42.7,-73.8,99

The last number, highlighted in yellow, is the frequency oflightning strikes in the vicinity of UAlbany on the date listedfirst.

DAY,CENTERLAT,CENTERLON,FCOUNT

2014-04-10,42.7,-73.8,1

2014-04-21,42.7,-73.8,19

                       *

                       *

                       *

2014-09-03,42.7,-73.8,102

Your task is to extract the dates and the correspondingnumber of lightning strikes

2014-04-10 :   1 lightning strikes were recorded.

2014-04-21 :   19 lightning strikes

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post