import pandas as pd
exchange_rates = pd.read_csv('euro-daily-hist_1999_2020.csv')
exchange_rates.head()
Period\Unit: | [Australian dollar ] | [Bulgarian lev ] | [Brazilian real ] | [Canadian dollar ] | [Swiss franc ] | [Chinese yuan renminbi ] | [Cypriot pound ] | [Czech koruna ] | [Danish krone ] | ... | [Romanian leu ] | [Russian rouble ] | [Swedish krona ] | [Singapore dollar ] | [Slovenian tolar ] | [Slovak koruna ] | [Thai baht ] | [Turkish lira ] | [US dollar ] | [South African rand ] | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2021-01-08 | 1.5758 | 1.9558 | 6.5748 | 1.5543 | 1.0827 | 7.9184 | NaN | 26.163 | 7.4369 | ... | 4.8708 | 90.8000 | 10.0510 | 1.6228 | NaN | NaN | 36.8480 | 9.0146 | 1.2250 | 18.7212 |
1 | 2021-01-07 | 1.5836 | 1.9558 | 6.5172 | 1.5601 | 1.0833 | 7.9392 | NaN | 26.147 | 7.4392 | ... | 4.8712 | 91.2000 | 10.0575 | 1.6253 | NaN | NaN | 36.8590 | 8.9987 | 1.2276 | 18.7919 |
2 | 2021-01-06 | 1.5824 | 1.9558 | 6.5119 | 1.5640 | 1.0821 | 7.9653 | NaN | 26.145 | 7.4393 | ... | 4.8720 | 90.8175 | 10.0653 | 1.6246 | NaN | NaN | 36.9210 | 9.0554 | 1.2338 | 18.5123 |
3 | 2021-01-05 | 1.5927 | 1.9558 | 6.5517 | 1.5651 | 1.0803 | 7.9315 | NaN | 26.227 | 7.4387 | ... | 4.8721 | 91.6715 | 10.0570 | 1.6180 | NaN | NaN | 36.7760 | 9.0694 | 1.2271 | 18.4194 |
4 | 2021-01-04 | 1.5928 | 1.9558 | 6.3241 | 1.5621 | 1.0811 | 7.9484 | NaN | 26.141 | 7.4379 | ... | 4.8713 | 90.3420 | 10.0895 | 1.6198 | NaN | NaN | 36.7280 | 9.0579 | 1.2296 | 17.9214 |
5 rows × 41 columns
exchange_rates.tail()
Period\Unit: | [Australian dollar ] | [Bulgarian lev ] | [Brazilian real ] | [Canadian dollar ] | [Swiss franc ] | [Chinese yuan renminbi ] | [Cypriot pound ] | [Czech koruna ] | [Danish krone ] | ... | [Romanian leu ] | [Russian rouble ] | [Swedish krona ] | [Singapore dollar ] | [Slovenian tolar ] | [Slovak koruna ] | [Thai baht ] | [Turkish lira ] | [US dollar ] | [South African rand ] | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5694 | 1999-01-08 | 1.8406 | NaN | NaN | 1.7643 | 1.6138 | NaN | 0.58187 | 34.938 | 7.4433 | ... | 1.3143 | 27.2075 | 9.1650 | 1.9537 | 188.8400 | 42.560 | 42.5590 | 0.3718 | 1.1659 | 6.7855 |
5695 | 1999-01-07 | 1.8474 | NaN | NaN | 1.7602 | 1.6165 | NaN | 0.58187 | 34.886 | 7.4431 | ... | 1.3092 | 26.9876 | 9.1800 | 1.9436 | 188.8000 | 42.765 | 42.1678 | 0.3701 | 1.1632 | 6.8283 |
5696 | 1999-01-06 | 1.8820 | NaN | NaN | 1.7711 | 1.6116 | NaN | 0.58200 | 34.850 | 7.4452 | ... | 1.3168 | 27.4315 | 9.3050 | 1.9699 | 188.7000 | 42.778 | 42.6949 | 0.3722 | 1.1743 | 6.7307 |
5697 | 1999-01-05 | 1.8944 | NaN | NaN | 1.7965 | 1.6123 | NaN | 0.58230 | 34.917 | 7.4495 | ... | 1.3168 | 26.5876 | 9.4025 | 1.9655 | 188.7750 | 42.848 | 42.5048 | 0.3728 | 1.1790 | 6.7975 |
5698 | 1999-01-04 | 1.9100 | NaN | NaN | 1.8004 | 1.6168 | NaN | 0.58231 | 35.107 | 7.4501 | ... | 1.3111 | 25.2875 | 9.4696 | 1.9554 | 189.0450 | 42.991 | 42.6799 | 0.3723 | 1.1789 | 6.9358 |
5 rows × 41 columns
exchange_rates.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 5699 entries, 0 to 5698 Data columns (total 41 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Period\Unit: 5699 non-null object 1 [Australian dollar ] 5699 non-null object 2 [Bulgarian lev ] 5297 non-null object 3 [Brazilian real ] 5431 non-null object 4 [Canadian dollar ] 5699 non-null object 5 [Swiss franc ] 5699 non-null object 6 [Chinese yuan renminbi ] 5431 non-null object 7 [Cypriot pound ] 2346 non-null object 8 [Czech koruna ] 5699 non-null object 9 [Danish krone ] 5699 non-null object 10 [Estonian kroon ] 3130 non-null object 11 [UK pound sterling ] 5699 non-null object 12 [Greek drachma ] 520 non-null object 13 [Hong Kong dollar ] 5699 non-null object 14 [Croatian kuna ] 5431 non-null object 15 [Hungarian forint ] 5699 non-null object 16 [Indonesian rupiah ] 5699 non-null object 17 [Israeli shekel ] 5431 non-null object 18 [Indian rupee ] 5431 non-null object 19 [Iceland krona ] 3292 non-null float64 20 [Japanese yen ] 5699 non-null object 21 [Korean won ] 5699 non-null object 22 [Lithuanian litas ] 4159 non-null object 23 [Latvian lats ] 3904 non-null object 24 [Maltese lira ] 2346 non-null object 25 [Mexican peso ] 5699 non-null object 26 [Malaysian ringgit ] 5699 non-null object 27 [Norwegian krone ] 5699 non-null object 28 [New Zealand dollar ] 5699 non-null object 29 [Philippine peso ] 5699 non-null object 30 [Polish zloty ] 5699 non-null object 31 [Romanian leu ] 5637 non-null float64 32 [Russian rouble ] 5699 non-null object 33 [Swedish krona ] 5699 non-null object 34 [Singapore dollar ] 5699 non-null object 35 [Slovenian tolar ] 2085 non-null object 36 [Slovak koruna ] 2608 non-null object 37 [Thai baht ] 5699 non-null object 38 [Turkish lira ] 5637 non-null float64 39 [US dollar ] 5699 non-null object 40 [South African rand ] 5699 non-null object dtypes: float64(3), object(38) memory usage: 1.8+ MB
shows 5,699 rows and 41 columns total. There are 3 columns which are float while the rest are object types.
exchange_rates.rename(columns={'[US dollar ]': 'US_dollar',
'Period\\Unit:': 'Time'},
inplace=True)
exchange_rates['Time'] = pd.to_datetime(exchange_rates['Time'])
exchange_rates.sort_values('Time', inplace=True)
exchange_rates.reset_index(drop=True, inplace=True)
euro_to_dollar = exchange_rates[['Time',"US_dollar"]]
exchange_rates["US_dollar"].value_counts()
- 62 1.2276 9 1.1215 8 1.1305 7 1.3532 6 .. 1.5746 1 1.1696 1 1.3855 1 1.4173 1 1.4539 1 Name: US_dollar, Length: 3528, dtype: int64
There is 3,528 values, but there should be 5,699 values. Some values are missing. Also, there are 62 '-' characters which need to be dropped.
euro_to_dollar = euro_to_dollar[euro_to_dollar["US_dollar"] != '-']
euro_to_dollar['US_dollar'] = euro_to_dollar['US_dollar'].astype(float)
euro_to_dollar.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 5637 entries, 0 to 5698 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 5637 non-null datetime64[ns] 1 US_dollar 5637 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 132.1 KB
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(euro_to_dollar["Time"],
euro_to_dollar["US_dollar"])
plt.show()
rolling_mean = euro_to_dollar['US_dollar'].rolling(30).mean()
plt.plot(euro_to_dollar["Time"],
rolling_mean)
plt.show()
### euro_to_dollar based on top economic events of the 21st century
Origin_to_Sep11 = euro_to_dollar[(euro_to_dollar['Time'] > '1999-01-04') & (euro_to_dollar['Time'] < '2001-09-11')]
Sep11_to_Katrina = euro_to_dollar[(euro_to_dollar['Time'] > '2001-09-11') & (euro_to_dollar['Time'] < '2005-08-29')]
Katrina_to_Housing_crisis = euro_to_dollar[(euro_to_dollar['Time'] > '2005-08-29') & (euro_to_dollar['Time'] < '2008-12-30')]
Housing_crisis_to_JTD = euro_to_dollar[(euro_to_dollar['Time'] > '2008-12-30') & (euro_to_dollar['Time'] < '2011-03-11')] ## 'Japan Triple Disaster'–Earthquake,Tsunami,Radioactive Leak
JTD_to_Greece_bailout = euro_to_dollar[(euro_to_dollar['Time'] > '2011-03-11') & (euro_to_dollar['Time'] < '2015-08-14')]
Greece_bailout_to_Brexit = euro_to_dollar[(euro_to_dollar['Time'] > '2015-08-14') & (euro_to_dollar['Time'] < '2016-06-23')]
Brexit_to_Covid_start = euro_to_dollar[(euro_to_dollar['Time'] > '2016-06-23') & (euro_to_dollar['Time'] < '2020-03-09')]
Covid_start_early_2021 = euro_to_dollar[(euro_to_dollar['Time'] > '2020-03-09') & (euro_to_dollar['Time'] < '2021-01-08')]
Origin_to_Sep11.info() #!
Sep11_to_Katrina.info() #2
Katrina_to_Housing_crisis.info() #3
Housing_crisis_to_JTD.info() ### HOUSING CRISIS ⌄⌄⌄⌄⌄ #4
JTD_to_Greece_bailout.info() ### ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄
Greece_bailout_to_Brexit.info() ### TO BREXIT
Brexit_to_Covid_start.info() ##5 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>this interval is from BREXIT being voted in
Covid_start_early_2021.info() #6
<class 'pandas.core.frame.DataFrame'> Int64Index: 690 entries, 1 to 700 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 690 non-null datetime64[ns] 1 US_dollar 690 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 16.2 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 1013 entries, 702 to 1734 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 1013 non-null datetime64[ns] 1 US_dollar 1013 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 23.7 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 852 entries, 1736 to 2605 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 852 non-null datetime64[ns] 1 US_dollar 852 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 20.0 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 564 entries, 2607 to 3178 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 564 non-null datetime64[ns] 1 US_dollar 564 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 13.2 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 1130 entries, 3180 to 4315 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 1130 non-null datetime64[ns] 1 US_dollar 1130 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 26.5 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 219 entries, 4317 to 4535 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 219 non-null datetime64[ns] 1 US_dollar 219 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 5.1 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 947 entries, 4537 to 5483 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 947 non-null datetime64[ns] 1 US_dollar 947 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 22.2 KB <class 'pandas.core.frame.DataFrame'> Int64Index: 213 entries, 5485 to 5697 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Time 213 non-null datetime64[ns] 1 US_dollar 213 non-null float64 dtypes: datetime64[ns](1), float64(1) memory usage: 5.0 KB
# ## import datetime
Origin_Sep11 = Origin_to_Sep11["US_dollar"].rolling(30).mean()
# plt.plot(Origin_to_Sep11['Time'],
# Origin_Sep11)
# plt.xticks(rotation = 45)
# plt.xlim([datetime.date(1999, 1, 4), datetime.date(2001, 9, 15)])
# ## plt.xticks(range(1,5,1),rotation = 45)
# plt.show()
from matplotlib.dates import DateFormatter
import matplotlib.dates as mdates
import datetime
plt.style.use('ggplot')
fig, ax = plt.subplots(figsize=(6,8))
ax.plot(Origin_to_Sep11['Time'],Origin_Sep11)
ax.plot(Origin_to_Sep11['Time'][0:200],Origin_Sep11[0:200], ##In order to bold or highlight a certain piece of data
color='#af0b1e', linewidth=2.5)
plt.xticks(rotation = 45)
plt.xlim([datetime.date(1999, 1, 4), datetime.date(2001, 9, 30)])
ax.xaxis.set_major_locator(mdates.MonthLocator(interval=5))
ax.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.show()
plt.style.use('ggplot')
fig, ax = plt.subplots(figsize=(9,6))
ax.plot(euro_to_dollar['Time'],rolling_mean)
ax.plot(euro_to_dollar['Time'][0:700],rolling_mean[0:700], ##In order to bold or highlight a certain piece of data
color='#dcb56e', linewidth=2.5)
ax.plot(euro_to_dollar['Time'][701:1734],rolling_mean[701:1734], ##In order to bold or highlight a certain piece of data
color='#2d2de5', linewidth=2.5)
ax.plot(euro_to_dollar['Time'][1735:2605],rolling_mean[1735:2605], ##In order to bold or highlight a certain piece of data
color='#bb00ff', linewidth=2.5)
ax.plot(euro_to_dollar['Time'][2606:3178],rolling_mean[2606:3178], ##In order to bold or highlight a certain piece of data
color='#ffffff', linewidth=2.5)
ax.plot(euro_to_dollar['Time'][3179:4535],rolling_mean[3179:4535], ##In order to bold or highlight a certain piece of data
color='#9ed670', linewidth=2.5)
## ax.plot(euro_to_dollar['Time'][4316:4535],rolling_mean[4316:4535], ##In order to bold or highlight a certain piece of data
## color='#310e59', linewidth=2.5)
ax.plot(euro_to_dollar['Time'][4535:5483],rolling_mean[4535:5483], ##In order to bold or highlight a certain piece of data
color='#cb99c9', linewidth=2.5)
plt.xticks(rotation = 45)
plt.xlim([datetime.date(1999, 1, 4), datetime.date(2021, 1, 8)])
ax.xaxis.set_major_locator(mdates.MonthLocator(interval=30))
ax.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.show()
fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3,
figsize=(10,3))
import matplotlib.style as style
style.use('fivethirtyeight')
import datetime as dt
fig = plt.figure(figsize=(30,20))
#1ST GRAPH
ax1 = fig.add_subplot(271)
ax1.plot(euro_to_dollar['Time'][0:700],rolling_mean[0:700], ##In order to bold or highlight a certain piece of data
color='#dcb56e', linewidth=2.5)
plt.xlim([datetime.date(1999, 1, 4), datetime.date(2001, 9, 11)])
ax1.xaxis.set_major_locator(mdates.MonthLocator(interval=4))
ax1.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
plt.ylim([.8,1.6])
ax1.text(datetime.date(1999, 4, 4), 1.7,
s = 'Invention to 911', color='#2d2de5', fontsize = 24)
#2ND GRAPH
ax2 = fig.add_subplot(272)
ax2.plot(euro_to_dollar['Time'][701:1734],rolling_mean[701:1734], color='#2d2de5', linewidth=2.5) ##In order to bold or highlight a certain piece of data
plt.xlim([datetime.date(2001, 9, 11), datetime.date(2005, 8, 29)])
ax2.xaxis.set_major_locator(mdates.MonthLocator(interval=4))
ax2.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
plt.ylim([.8,1.6])
ax2.text(datetime.date(2002, 1, 11), 1.7,
s = '911 to Katrina', color='#2d2de5', fontsize = 24)
#3RD GRAPH
ax3 = fig.add_subplot(273)
ax3.plot(euro_to_dollar['Time'][1735:2605],rolling_mean[1735:2605], ##In order to bold or highlight a certain piece of data
color='#bb00ff', linewidth=2.5)
plt.xlim([datetime.date(2005, 8, 29), datetime.date(2008, 12, 30)])
ax3.xaxis.set_major_locator(mdates.MonthLocator(interval=4))
ax3.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
plt.ylim([.8,1.6])
ax3.set_yticklabels([])
ax3.text(datetime.date(2005, 4, 29), 1.7,
s = 'Katrina to Housing Crisis', color='#bb00ff', fontsize = 24)
ax3.annotate('max', (dt.datetime(2008,7,15),1.599), xytext=(10, -10),
textcoords='offset points')
#4TH GRAPH
ax4 = fig.add_subplot(2,7,(4,5))
ax4.plot(euro_to_dollar['Time'][2606:4537],rolling_mean[2606:4537], ##In order to bold or highlight a certain piece of data
color='#ffa500', linewidth=2.5)
plt.xlim([datetime.date(2008, 12, 30), datetime.date(2016, 6, 23)])
ax4.xaxis.set_major_locator(mdates.MonthLocator(interval=8))
ax4.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
plt.ylim([.8,1.6])
ax4.text(datetime.date(2009, 12, 30), 1.7,
s = 'Housing Crisis to Brexit Upvote', color='#ffa500', fontsize = 24)
#5TH GRAPH
ax5 = fig.add_subplot(2,7,6)
ax5.plot(euro_to_dollar['Time'][4538:5483],rolling_mean[4538:5483], color='#9ed670', linewidth=2.5) ##In order to bold or highlight a certain piece of data
plt.xlim([datetime.date(2016, 6, 23), datetime.date(2020, 3, 9)])
ax5.xaxis.set_major_locator(mdates.MonthLocator(interval=8))
ax5.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
plt.ylim([.8,1.6])
ax5.text(datetime.date(2016, 11, 23), 1.7,
s = 'Brexit Upvote', color='#9ed670', fontsize = 24)
ax5.text(datetime.date(2016, 11, 23), 1.65,
s = 'to Coronavirus', color='#9ed670', fontsize = 24)
#6TH GRAPH
ax6 = fig.add_subplot(2,7,7)
ax6.plot(euro_to_dollar['Time'][5484:5697],rolling_mean[5484:5697],
color='#24778c', linewidth=2.5)
plt.xlim([datetime.date(2020, 3, 9), datetime.date(2021, 1, 8)])
ax6.xaxis.set_major_locator(mdates.MonthLocator(interval=1))
ax6.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
plt.xticks(rotation = 90)
ax6.set_yticklabels([])
plt.ylim([.8,1.6])
ax6.text(datetime.date(2020, 2, 9), 1.7,
s = 'Coronavirus to Current', color='#24778c', fontsize = 24)
axes = [ax2,ax3,ax4,ax5,ax6]
for ax in axes:
ax.set_yticklabels(labels=[])
#1ST INTERVAL
ax7 = fig.add_subplot(212)
ax7.plot(euro_to_dollar['Time'][0:700],rolling_mean[0:700], ##In order to bold or highlight a certain piece of data
color='#dcb56e', linewidth=2.5)
plt.xticks(rotation = 90)
plt.xlim([datetime.date(1999, 1, 4), datetime.date(2021, 1, 8)])
ax7.xaxis.set_major_locator(mdates.MonthLocator(interval=6))
ax7.xaxis.set_major_formatter(DateFormatter("%Y-%m"))
#2ND INTERVAL
ax7.plot(euro_to_dollar['Time'][701:1734],rolling_mean[701:1734], ##In order to bold or highlight a certain piece of data
color='#2d2de5', linewidth=2.5)
#3RD INTERVAL
ax7.plot(euro_to_dollar['Time'][1735:2605],rolling_mean[1735:2605], ##In order to bold or highlight a certain piece of data
color='#bb00ff', linewidth=2.5)
#4TH INTERVAL
ax7.plot(euro_to_dollar['Time'][2606:4537],rolling_mean[2606:4537], ##In order to bold or highlight a certain piece of data
color='#ffa500', linewidth=2.5)
#5TH INTERVAL
ax7.plot(euro_to_dollar['Time'][4538:5483],rolling_mean[4538:5483], ##In order to bold or highlight a certain piece of data
color='#9ed670', linewidth=2.5)
#6TH INTERVAL
ax7.plot(euro_to_dollar['Time'][5484:5697],rolling_mean[5484:5697], ##In order to bold or highlight a certain piece of data
color='#24778c', linewidth=2.5)
import matplotlib.dates as mdates
ax7.axvspan(*mdates.datestr2num(['4/1/2008', '9/1/2008']), color='grey', alpha=0.4)
plt.show()
help(ax.fill_between)
Help on method fill_between in module matplotlib.axes._axes: fill_between(x, y1, y2=0, where=None, interpolate=False, step=None, *, data=None, **kwargs) method of matplotlib.axes._subplots.AxesSubplot instance Fill the area between two horizontal curves. The curves are defined by the points (*x*, *y1*) and (*x*, *y2*). This creates one or multiple polygons describing the filled area. You may exclude some horizontal sections from filling using *where*. By default, the edges connect the given points directly. Use *step* if the filling should be a step function, i.e. constant in between *x*. Parameters ---------- x : array (length N) The x coordinates of the nodes defining the curves. y1 : array (length N) or scalar The y coordinates of the nodes defining the first curve. y2 : array (length N) or scalar, optional, default: 0 The y coordinates of the nodes defining the second curve. where : array of bool (length N), optional, default: None Define *where* to exclude some horizontal regions from being filled. The filled regions are defined by the coordinates ``x[where]``. More precisely, fill between ``x[i]`` and ``x[i+1]`` if ``where[i] and where[i+1]``. Note that this definition implies that an isolated *True* value between two *False* values in *where* will not result in filling. Both sides of the *True* position remain unfilled due to the adjacent *False* values. interpolate : bool, optional This option is only relevant if *where* is used and the two curves are crossing each other. Semantically, *where* is often used for *y1* > *y2* or similar. By default, the nodes of the polygon defining the filled region will only be placed at the positions in the *x* array. Such a polygon cannot describe the above semantics close to the intersection. The x-sections containing the intersection are simply clipped. Setting *interpolate* to *True* will calculate the actual intersection point and extend the filled region up to this point. step : {'pre', 'post', 'mid'}, optional Define *step* if the filling should be a step function, i.e. constant in between *x*. The value determines where the step will occur: - 'pre': The y value is continued constantly to the left from every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the value ``y[i]``. - 'post': The y value is continued constantly to the right from every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the value ``y[i]``. - 'mid': Steps occur half-way between the *x* positions. Other Parameters ---------------- **kwargs All other keyword arguments are passed on to `.PolyCollection`. They control the `.Polygon` properties: Properties: agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alpha: float or None animated: bool antialiased or aa or antialiaseds: bool or sequence of bools array: ndarray capstyle: {'butt', 'round', 'projecting'} clim: (vmin: float, vmax: float) clip_box: `.Bbox` clip_on: bool clip_path: Patch or (Path, Transform) or None cmap: colormap or registered colormap name color: color or sequence of rgba tuples contains: callable edgecolor or ec or edgecolors: color or sequence of colors or 'face' facecolor or facecolors or fc: color or sequence of colors figure: `.Figure` gid: str hatch: {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layout: bool joinstyle: {'miter', 'round', 'bevel'} label: object linestyle or dashes or linestyles or ls: {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidth or linewidths or lw: float or sequence of floats norm: `.Normalize` offset_position: {'screen', 'data'} offsets: array-like (N, 2) or (2,) path_effects: `.AbstractPathEffect` picker: None or bool or float or callable pickradius: unknown rasterized: bool or None sketch_params: (scale: float, length: float, randomness: float) snap: bool or None transform: `.Transform` url: str urls: List[str] or None visible: bool zorder: float Returns ------- `.PolyCollection` A `.PolyCollection` containing the plotted polygons. See Also -------- fill_betweenx : Fill between two sets of x-values. Notes ----- .. [notes section required to get data note injection right] .. note:: In addition to the above described arguments, this function can take a **data** keyword argument. If such a **data** argument is given, the following arguments are replaced by **data[<arg>]**: * All arguments with the following names: 'where', 'x', 'y1', 'y2'. Objects passed as **data** must support item access (``data[<arg>]``) and membership test (``<arg> in data``).
print(euro_to_dollar['US_dollar'][0:5697].idxmax())
print(euro_to_dollar['US_dollar'][0:5697].max()) ## Max Euro value since its invention
print('\n')
print(euro_to_dollar['US_dollar'][0:700].idxmax())
print(euro_to_dollar['Time'][1])
print(euro_to_dollar['US_dollar'][0:700].max())
2486 1.599 1 1999-01-05 00:00:00 1.179
print(euro_to_dollar['US_dollar'][701:1734].idxmax())
print(euro_to_dollar['Time'][1561])
print(euro_to_dollar['US_dollar'][701:1734].max())
1561 2004-12-28 00:00:00 1.3633
print(euro_to_dollar['US_dollar'][1735:2605].idxmax())
print(euro_to_dollar['Time'][2486])
print(euro_to_dollar['US_dollar'][1735:2605].max())
2486 2008-07-15 00:00:00 1.599
print(euro_to_dollar['US_dollar'][2606:3178].idxmax())
print(euro_to_dollar['Time'][2848])
print(euro_to_dollar['US_dollar'][2606:3178].max())
2848 2009-12-03 00:00:00 1.512
print(euro_to_dollar['US_dollar'][3179:4535].idxmax())
print(euro_to_dollar['Time'][3241])
print(euro_to_dollar['US_dollar'][3179:4535].max())
3241 2011-06-07 00:00:00 1.4652
euro_to_dollar['Time'][2486]
Timestamp('2008-07-15 00:00:00')
euro_to_dollar['Time'][4538]
Timestamp('2016-06-27 00:00:00')