0% found this document useful (0 votes)
8 views5 pages

Homework 1

Homework

Uploaded by

Jay Kelkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Homework 1

Homework

Uploaded by

Jay Kelkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

FIN42110 Ronan Ó Donnabháin 23205122

FIN42110: Homework 1
Module Leader: Richard McGee
Due: February 9th 2024

Report Submission Ronan Ó Donnabháin 23205122

Part 1: Yahoo Finance


My assigned stock ticker in the ClassList.csv file is KO, for The Coca Cola Company. I used
‘yfinance’ and ‘mplfinance’ Python packages to download the last year of price information
for KO stock and plotted the data as a candlestick plot, with a clear title and axis labels.
Figure 1 below displays the graph produced by my Python code.

Figure 1: candlestick plot made with mplfinance


FIN42110 Ronan Ó Donnabháin 23205122

Part 2: PDF Scraping


I used ‘tabula-py’ to read the table on the first page of the provided GPD.pdf report, and
stored the information in a Pandas data frame. The data frame was then converted to excel to
be displayed in this report, as is shown below in Table 1.

Table 1: GDP data frame


Ranking Economy Name GDP (US$)
USA 1 United States 20,936,600
CHN 2 China 14,722,731
JPN 3 Japan 5,064,873
DEU 4 Germany 3,806,060
GBR 5 United Kingdom 2,707,744
IND 6 India 2,622,984
FRA 7 France 2,603,004
ITA 8 Italy 1,886,445
CAN 9 Canada 1,643,408
KOR 10 Korea, Rep. 1,630,525
RUS 11 Russian Federation 1,483,498
BRA 12 Brazil 1,444,733
AUS 13 Australia 1,330,901
ESP 14 Spain 1,281,199
MEX 15 Mexico 1,076,163
IDN 16 Indonesia 1,058,424
NLD 17 Netherlands 912,242
CHE 18 Switzerland 747,969
TUR 19 Turkey 720,101
SAU 20 Saudi Arabia 700,118
POL 21 Poland 594,165
SWE 22 Sweden 537,610
BEL 23 Belgium 515,332
THA 24 Thailand 501,795
NGA 25 Nigeria 432,294
AUT 26 Austria 428,965
ARE 27 United Arab Emirates 421,142
IRL 28 Ireland 418,622
ISR 29 Israel 401,954
ARG 30 Argentina 383,067
EGY 31 Egypt, Arab Rep. 363,069
NOR 32 Norway 362,009
PHL 33 Philippines 361,489
DNK 34 Denmark 355,184
HKG 35 Hong Kong SAR, China 346,586
SGP 36 Singapore 339,998
MYS 37 Malaysia 336,664
BGD 38 Bangladesh 324,239
ZAF 39 South Africa 301,924
COL 40 Colombia 271,347
FIN 41 Finland 271,234
VNM 42 Vietnam 271,158
PAK 43 Pakistan 263,687
CHL 44 Chile 252,940
ROU 45 Romania 248,716
CZE 46 Czech Republic 243,530
PRT 47 Portugal 231,256
NZL 48 New Zealand 212,482
PER 49 Peru 202,014
IRN 50 Iran, Islamic Rep. 191,718
GRC 51 Greece 189,410
KAZ 52 Kazakhstan 169,835
IRQ 53 Iraq 167,224
UKR 54 Ukraine 155,582
HUN 55 Hungary 155,013
QAT 56 Qatar 146,374
DZA 57 Algeria 145,164
KWT 58 Kuwait 136,197
MAR 59 Morocco 112,871
ETH 60 Ethiopia 107,645
SVK 61 Slovak Republic 104,574
PRI 62 Puerto Rico 103,138
CUB 63 Cuba 103,131
KEN 64 Kenya 98,843
ECU 65 Ecuador 98,808
FIN42110 Ronan Ó Donnabháin 23205122

Part 3: Crypto Punk Web Scraping


I used ‘requests’ and ‘BeatifulSoup’ to extract the attributes of a specific CryptoPunk.
CryptoPunk #25, identified from the ClassList.csv file, possesses one attribute: 'Wild White
Hair'. The script made a HTTP GET request to the CryptoPunk's detail page and parsed the
HTML content to locate and extract the attribute information.

Attributes of CryptoPunk #25: ['1 attributes', 'Wild White Hair']


FIN42110 Ronan Ó Donnabháin 23205122

Appendix
FIN42110 Ronan Ó Donnabháin 23205122

You might also like