File size: 1,735 Bytes
29b0628
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
"""676_252_1434_72

Automatically generated by Colab.

Original file is located at
    https://colab.research.google.com/drive/1FniZJX1OfI1PltPCXhpw50znN1aYMFcP
"""

import numpy as np
import pandas as pd

import os
for dirname, _, filenames in os.walk('/content/world_bank_data_2025.csv'):
  for filename in filenames:
    print(os.path.join(dirname, filename))

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = pd.read_csv('/content/world_bank_data_2025.csv')
df.head()

print("Shape of dataset:", df.shape)
print("COlumns:\n", df.columns.tolist())
print("\nMissing values:\n", df.isnull().sum())
df.dtypes

indicators = df.columns.difference(['country_name', 'country_id', 'year'])
df_clean = df.dropna(subset=indicators, how='all')

top_countries = df_clean.groupby('country_name')['GDP (Current USD)'].mean().nlargest(10).index
gdp_plot = df_clean[df_clean['country_name'].isin(top_countries)]

plt.figure(figsize=(12, 6))
sns.lineplot(data=gdp_plot, x='year', y='GDP (Current USD)', hue='country_name')
plt.title('GDP Trends (Top 10 Countries by Avg GDP)')
plt.ylabel('GDP in USD')
plt.xticks(rotation=45)
plt.grid(True)
plt.tight_layout()
plt.show()

numeric_df = df_clean.select_dtypes(include=['number']).drop(columns=['year'])
plt.figure(figsize=(10, 8))
sns.heatmap(numeric_df.corr(), annot=True, cmap='coolwarm', fmt='.2f')
plt.title('Correlation Between Economic Indicators')
plt.show()

inflation_2020 = df_clean[df_clean['year'] == 2020]
plt.figure(figsize=(12, 5))
sns.histplot(inflation_2020['Inflation (CPI %)'].dropna(), bins=30, kde=True, color='orange')
plt.title('Inflation Rate Distribution - 2020')
plt.xlabel('Inflation (CPI %)')
plt.grid(True)
plt.show()