Answer To: CIV3506: CONCRETE STRUCTURES Semester 1, 2021 CIV 3506 – Concrete Structures Semester 1, 2021...
Prateek answered on May 19 2021
1-4ovxhafo.jpg
2-w54qiws2.jpg
3-uufrtjhh.jpg
4-pbtyvvi4.jpg
assign1-t4nm24vl.py
import requests
import pandas as pd
city_name=input("Enter city name : ")
url = 'https://api.openweathermap.org/data/2.5/weather?'
params = {
'q': city_name,
'units': 'metric',
'appid': '8987d44a0eab2303f5934c58e0740955'
}
response = requests.get(url, params=params)
json_response = response.json()
temp_min=json_response['main']['temp_min']
temp_max= json_response['main']['temp_max']
city_name=json_response['name']
humidity= json_response['main']['humidity']
weather_desc=json_response['weather'][0]['description']
data=[[city_name,temp_min,temp_max,humidity,weather_desc]]
df=pd.DataFrame(data,columns=['city','Minimum_temprature','Maximun_Temprature','Humidity','weather_desc'])
df.to_csv("data.csv",mode='a',header=False)
print(df)
data-jpf2bhop.csv
,city,Minimum_temprature,Maximun_Temprature,Humidity,weather_desc
0,Chicago,18.33,19,59,overcast clouds
0,Los Angeles,11.67,17.78,67,overcast clouds
0,Albany,16.23,20.93,47,overcast clouds
0,Brooklyn,18.25,23.97,47,few clouds
0,Guangzhou,27.97,29.97,66,light rain
0,Erie,19.44,20.56,43,clear sky
0,Flint,17.75,21.96,70,clear sky
0,Gary,17,18.33,82,clear sky
0,Livonia,16.88,22.17,61,few clouds
0,Lynn,18.43,24.14,47,broken clouds
0,Parma,23.26,24.32,29,few clouds
0,Scranton,17.31,21.64,58,clear sky
0,Utica,17.16,20.85,56,scattered clouds
0,Youngstown,16.62,22.07,61,clear sky
0,Trenton,18.98,22.83,59,clear sky
0,Wilmington,19.36,22.14,81,overcast clouds
0,Roanoke,13.16,18.62,89,overcast clouds
0,Kenosha,15.67,19.1,78,clear sky
0,Hammond,16.16,18.43,80,clear sky
0,Duluth,13.49,19.63,64,clear sky
0,Camden,18.19,22.99,54,clear sky
0,New York,18.86,24.03,45,clear sky
0,Phoenix,18.91,24.23,36,few clouds
0,San Diego,13.71,16.99,86,overcast clouds
0,Los Angeles,12.2,17.46,80,overcast clouds
0,New York,18.86,24.43,45,clear sky
interaction-diagram-0mp3b1cx.xlsx
Sheet1
Ku Nu Mu Nu Mu
Infinite 8475.76 0 5509.244 0
1 4690.22 307.554 3048.643 199.9101
0.8 3555.4 370.442 2311.01 240.7873
0.545 1604.44 451.65 1042.886 293.5725
0.4 641.2 414.761 446.2752 288.673656
0.2 -937.794 239.864 -751.172994 192.131064
0 5509.244
199.9101 3048.643
240.7873 2311.01
293.5725 1042.886
288.673656 446.2752
192.131064 -751.172994
0 199.9101 240.78730000000002 293.57249999999999 288.67365599999999 192.13106400000001 5509.2440000000006 3048.6430000000005 2311.0100000000002 1042.886 446.27519999999998 -751.17299400000002
Sheet2
Sheet3
projectreport-bhc02xsg.docx
PROJECT REPORT
Firstly, we would analyse which Api we are going to use in our project and then we will implement using required functionalities. In this project I am using open weather map API. For making request to the Api we firstly need Api key that we get when we login to the open weather map Api dashboard. In this project we are using requests library of Python to make a request to the Api by entering the city name which we want to search. The response which we get is in the form of json that is key value pairs are present. So to display the relevant information we need to access the key of the json response using functionality of dictionary in python. The relevant information we are saving in data frame which we created using pandas and then using “to_csv” method of pandas library we are appending the information to our csv file. Therefore this project is a way to search the weather details of a particular city and collecting the data in a csv file.
task-1-fnumabyd.pdf
g)
i L= 4'-9Yn
/La=
3 a tT)Po.
(,!rn
Q.+ Lo co). ?^ Ca^x?\' , q L D qoJnt t{""^f o')4*^b* Um-< J
3> Au^A odanm...