Code Monkey home page Code Monkey logo

hw1's Introduction

hw1

target_data = list(filter(lambda i: i['TEMP'] != '-99.000', data)) #filt the data which equals to -99.000 in 'TEMP', and put all the data into target_data

target_data = list(filter(lambda i: i['TEMP'] != '-999.000', target_data)) #filt the data which equals to -999.000 in 'TEMP', and put all the data into target_data

target_data_C0A880 = list(filter(lambda i: i['station_id'] == 'C0A880', target_data)) #filt the target_data which is in station 'C0A880', and put all the data into target_data_C0A880

target_data_C0F9A0 = list(filter(lambda i: i['station_id'] == 'C0F9A0', target_data)) #filt the target_data which is in station 'C0F9A0', and put all the data into target_data_C0F9A0

target_data_C0G640 = list(filter(lambda i: i['station_id'] == 'C0G640', target_data)) #filt the target_data which is in station 'C0G640', and put all the data into target_data_C0G640

target_data_C0R190 = list(filter(lambda i: i['station_id'] == 'C0R190', target_data)) #filt the target_data which is in station 'C0R190', and put all the data into target_data_C0R190

target_data_C0X260 = list(filter(lambda i: i['station_id'] == 'C0X260', target_data)) #filt the target_data which is in station 'C0X260', and put all the data into target_data_C0X260

result = [] #create a list of 'result' which is for the output data_temp = [] #create a list for the temporary data for each station

for temp in target_data_C0A880: #running through all the data in station C0A880 data_temp.append(float(temp['TEMP'])) #change all the data from char to float result.append(('C0A880',max(data_temp))) #find the maiximum tempurature of that station del data_temp[:] #erase the data in data_temp

for temp in target_data_C0F9A0: #running through all the data in station C0F9A0 data_temp.append(float(temp['TEMP'])) #change all the data from char to float result.append(('C0F9A0',max(data_temp))) #find the maiximum tempurature of that station del data_temp[:] #erase the data in data_temp

for temp in target_data_C0G640: #running through all the data in station C0G640 data_temp.append(float(temp['TEMP'])) #change all the data from char to float result.append(('C0G640',max(data_temp))) #find the maiximum tempurature of that station del data_temp[:] #erase the data in data_temp

for temp in target_data_C0R190: #running through all the data in station C0R190 data_temp.append(float(temp['TEMP'])) #change all the data from char to float result.append(('C0R190',max(data_temp))) #find the maiximum tempurature of that station del data_temp[:] #erase the data in data_temp

for temp in target_data_C0X260: #running through all the data in station C0X260 data_temp.append(float(temp['TEMP'])) #change all the data from char to float result.append(('C0X260',max(data_temp))) #find the maiximum tempurature of that station

result.sort() #sort the result list

print(result) #print the result.

RESULTS: [('C0A880', 26.7), ('C0F9A0', 31.2), ('C0G640', 31.4), ('C0R190', 34.6), ('C0X260', 31.7)]

hw1's People

Contributors

liusam0117 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.