From 8e4b26876b04accfba07d2972f05c8b30bf60df3 Mon Sep 17 00:00:00 2001 From: yashoshinde <54619868+yashoshinde@users.noreply.github.com> Date: Wed, 22 Jul 2020 11:48:20 +0530 Subject: [PATCH 1/2] Add files via upload --- wassignment.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 wassignment.py diff --git a/wassignment.py b/wassignment.py new file mode 100644 index 0000000..f4b5f16 --- /dev/null +++ b/wassignment.py @@ -0,0 +1,43 @@ + + +import numpy as np #importing the libraries +import matplotlib.pyplot as plt #Doing the Task-3 +import json +from datetime import datetime as d + +with open('data.json') as w: # + data=json.load(w) +with open('latest-rates.json') as y: + latest_rates=json.load(y) + +n= data['rates'] #printing the dataset (data.json) +print (n) +m=latest_rates['rates'] #printing the dataset(latest-rates) +print(m) + +fd=d(2019,1,1) +ld=d(2019,1,31) +values=sorted(data['rates']) +INR=list() +GBP=list() +date=list() + +for x in values: + day=d.strptime(x,'%Y-%m-%d') + if day<=ld and day>=fd: + INR.append(data['rates'][x]['INR']) + GBP.append(data['rates'][x]['GBP']) + date.append([day.day]) + + +plt.plot(date,INR,linewidth=2.0,linestyle='solid',label='INR') #setting up the parameters +plt.plot(date,INR,linewidth=2.0,linestyle='solid',label='GBP') + +plt.xlabel('January 2019') #plotting on x-axix +plt.xticks(np.arange(32)) +plt.ylabel('values with respect to EUR')#plotting on y-axis +plt.title("Plotting the graph of INR and GBP exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019 ") +I=plt.legend(loc="center right") #title for the graph +I.get_texts()[0].set_text("INR="+str(latest_rates['rates']['INR'])) +I.get_texts()[1].set_text("GDP="+str(latest_rates['rates']['GDP'])) +plt.show() \ No newline at end of file From 2ee200730bcdd04fce39de9ce1dedb7241a2ec97 Mon Sep 17 00:00:00 2001 From: yashoshinde <54619868+yashoshinde@users.noreply.github.com> Date: Wed, 22 Jul 2020 11:52:01 +0530 Subject: [PATCH 2/2] Update wassignment.py --- wassignment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wassignment.py b/wassignment.py index f4b5f16..efb7f9d 100644 --- a/wassignment.py +++ b/wassignment.py @@ -1,5 +1,5 @@ - +#yashodhan shinde #k.k.wagh college #8857865415 #yashodhanshinde67@gmail.com import numpy as np #importing the libraries import matplotlib.pyplot as plt #Doing the Task-3 import json @@ -40,4 +40,4 @@ I=plt.legend(loc="center right") #title for the graph I.get_texts()[0].set_text("INR="+str(latest_rates['rates']['INR'])) I.get_texts()[1].set_text("GDP="+str(latest_rates['rates']['GDP'])) -plt.show() \ No newline at end of file +plt.show()