Update README.md
#2
by
iamramzan
- opened
README.md
CHANGED
@@ -1,3 +1,93 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
task_categories:
|
4 |
+
- text-classification
|
5 |
+
- translation
|
6 |
+
- summarization
|
7 |
+
- text-generation
|
8 |
+
language:
|
9 |
+
- en
|
10 |
+
tags:
|
11 |
+
- scrapy
|
12 |
+
- pandas
|
13 |
+
- datasets
|
14 |
+
size_categories:
|
15 |
+
- n<1K
|
16 |
+
---
|
17 |
+
## Dataset Summary
|
18 |
+
This dataset contains information about the largest banks globally, including their rank, name, and total assets (in US$ billion as of 2023). The data was scraped from [Wikipedia's List of Largest Banks](https://en.wikipedia.org/wiki/List_of_largest_banks). It can be used for financial analysis, market research, and educational purposes.
|
19 |
+
|
20 |
+
## Dataset Structure
|
21 |
+
### Columns
|
22 |
+
- **Rank**: The rank of the bank based on total assets.
|
23 |
+
- **Bank Name**: The name of the bank.
|
24 |
+
- **Total Assets (2023, US$ billion)**: The total assets of the bank in billions of US dollars as of 2023.
|
25 |
+
|
26 |
+
### Example
|
27 |
+
| Rank | Bank Name | Total Assets (2023, US$ billion) |
|
28 |
+
|------|--------------------|-----------------------------------|
|
29 |
+
| 1 | Industrial & Commercial Bank of China (ICBC) | 5,000 |
|
30 |
+
| 2 | China Construction Bank | 4,500 |
|
31 |
+
|
32 |
+
## Source
|
33 |
+
The data was scraped from [Wikipedia's List of Largest Banks](https://en.wikipedia.org/wiki/List_of_largest_banks) using Python and Scrapy.
|
34 |
+
|
35 |
+
## Usage
|
36 |
+
This dataset can be used for:
|
37 |
+
- Financial market research.
|
38 |
+
- Trend analysis in global banking.
|
39 |
+
- Educational purposes and data visualization.
|
40 |
+
|
41 |
+
## Licensing
|
42 |
+
The data is publicly available under [Wikipedia's Terms of Use](https://foundation.wikimedia.org/wiki/Terms_of_Use).
|
43 |
+
|
44 |
+
## Limitations
|
45 |
+
- The data may not reflect real-time changes as it was scraped from a static page.
|
46 |
+
- Possible inaccuracies due to updates or inconsistencies on the source page.
|
47 |
+
|
48 |
+
## Acknowledgements
|
49 |
+
Thanks to Wikipedia and the contributors of the "List of Largest Banks" page.
|
50 |
+
|
51 |
+
## Citation
|
52 |
+
If you use this dataset, please cite it as:
|
53 |
+
```
|
54 |
+
@misc{largestbanks2023,
|
55 |
+
author = {Your Name or Organization},
|
56 |
+
title = {Largest Banks Dataset},
|
57 |
+
year = {2023},
|
58 |
+
publisher = {Hugging Face},
|
59 |
+
url = {https://huggingface.co/datasets/your-dataset-name}
|
60 |
+
}
|
61 |
+
```
|
62 |
+
## Who are the source Data producers ?
|
63 |
+
The data is machine-generated (using web scraping) and subjected to human additional treatment.
|
64 |
+
|
65 |
+
below, I provide the script I created to scrape the data (as well as my additional treatment):
|
66 |
+
|
67 |
+
import scrapy
|
68 |
+
|
69 |
+
class LargestBanksSpider(scrapy.Spider):
|
70 |
+
name = "largest_banks"
|
71 |
+
start_urls = ["https://en.wikipedia.org/wiki/List_of_largest_banks"]
|
72 |
+
|
73 |
+
def parse(self, response):
|
74 |
+
# Locate the table containing the data
|
75 |
+
table = response.xpath("//table[contains(@class, 'wikitable')]")
|
76 |
+
|
77 |
+
# Extract rows from the table
|
78 |
+
rows = table.xpath(".//tr")
|
79 |
+
|
80 |
+
for row in rows[1:]: # Skip the header row
|
81 |
+
rank = row.xpath(".//td[1]//text()").get()
|
82 |
+
bank_name = row.xpath(".//td[2]//a/text() | .//td[2]//text()")
|
83 |
+
total_assets = row.xpath(".//td[3]//text()").get()
|
84 |
+
|
85 |
+
# Extract all text nodes for bank name and join them
|
86 |
+
bank_name = ''.join(bank_name.getall()).strip() if bank_name else None
|
87 |
+
|
88 |
+
if rank and bank_name and total_assets:
|
89 |
+
yield {
|
90 |
+
"Rank": rank.strip(),
|
91 |
+
"Bank Name": bank_name,
|
92 |
+
"Total Assets (2023, US$ billion)": total_assets.strip()
|
93 |
+
}
|