Menu

[Solved] Using Python Beginner Code See Example Code Use Assignment Gathered Together Interesting D Q37158093

Using python beginner code see example code of what to use forthis assignment

we have gathered together some interesting data into a filecalled harvardLightning.txt

The file contains all recorded lightning strikes in the harvardarea

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

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 were recorded.

                             *

                             *            

                             *

2014-09-03 :   102 lightning strikes wererecorded.

See if you can output the data with a more familiar dateformat:

(Hint: split the date and rearrange the elements)

04 10 2014 : 1 lightning strikes were recorded.

04 21 2014 : 19 lightning strikes were recorded.

Please use the following above code and comments to write thiscode

File sample :

DAY,CENTERLAT,CENTERLON,FCOUNT
2015-04-10,42.7,-73.8,1
2015-04-21,42.7,-73.8,19
2015-05-10,42.7,-73.8,1
2015-05-27,42.7,-73.8,7
2015-05-30,42.7,-73.8,7
2015-06-09,42.7,-73.8,99
2015-06-12,42.7,-73.8,34
2015-06-13,42.7,-73.8,276
2015-06-23,42.7,-73.8,5
2015-07-19,42.7,-73.8,110
2015-08-03,42.7,-73.8,62
2015-08-04,42.7,-73.8,3
2015-08-11,42.7,-73.8,3
2015-08-15,42.7,-73.8,45
2015-09-03,42.7,-73.8,102

Expert Answer


Answer to Using python beginner code see example code of what to use for this assignment we have gathered together some interestin… . . .

OR


Leave a Reply

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