{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":19989,"databundleVersionId":1160143,"sourceType":"competition"},{"sourceId":30346,"sourceType":"datasetVersion","datasetId":23752},{"sourceId":95812,"sourceType":"datasetVersion","datasetId":504},{"sourceId":731395,"sourceType":"datasetVersion","datasetId":376235},{"sourceId":1025062,"sourceType":"datasetVersion","datasetId":563278},{"sourceId":2048065,"sourceType":"datasetVersion","datasetId":1222432},{"sourceId":3733625,"sourceType":"datasetVersion","datasetId":1837456},{"sourceId":3991154,"sourceType":"datasetVersion","datasetId":2368258},{"sourceId":5005948,"sourceType":"datasetVersion","datasetId":2892932},{"sourceId":5245975,"sourceType":"datasetVersion","datasetId":3052452},{"sourceId":5262370,"sourceType":"datasetVersion","datasetId":3062606},{"sourceId":6101670,"sourceType":"datasetVersion","datasetId":3495122},{"sourceId":6211042,"sourceType":"datasetVersion","datasetId":3566603}],"dockerImageVersionId":30527,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"<div style=\"border-radius: 30px 0 30px 0px; border: 2px solid #00ea98; padding: 20px; background-color: #E8F6EF; text-align: center; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\">\n    <h1 style=\"color: #d81313; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); font-weight: bold; margin-bottom: 10px;\">🌍 Global Information | 2023</h1>\n</div>\n","metadata":{}},{"cell_type":"markdown","source":"<div style=\"display: flex; align-items: center;\">\n   <div style=\" display: flex; gap: 10px;\">\n      <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n      <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n       <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n   </div> \n   <div style=\"margin-left: auto; display: flex; gap: 10px;\">\n      <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n      <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n       <img src=\"https://media.giphy.com/media/jZTfM2sOyVqu8D0DC9/giphy.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n   </div>\n</div>\n\n<center><a href=\"https://www.buymeacoffee.com/zabih\" target=\"_blank\"><img src=\"https://www.codehim.com/wp-content/uploads/2022/09/bmc-button-640x180.png.webp\" alt=\"Buy Me A Coffee\" style=\"height: 50px; width: 200px; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a></center>\n\n","metadata":{}},{"cell_type":"markdown","source":"  \n\n\n# <p style=\"font-family:JetBrains Mono; font-weight:bold; letter-spacing: 2px; color:#007c3e; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style=\"color: red;\">1</span> | Introduction ✨</p>\n\n\n<div style=\"border-radius: 30px 0 30px 0px; border:#FFA500 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left \">\n   Welcome to the Global Country Information Dataset 2023 Notebook! This comprehensive dataset provides a wealth of information about countries worldwide, encompassing a wide range of indicators and attributes. With demographic statistics, economic indicators, environmental factors, healthcare metrics, education statistics, and more, this dataset offers a complete global perspective on various aspects of nations. We will delve into the data to extract insights, perform exploratory data analysis (EDA), and draw meaningful conclusions.\n</div>\n","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; letter-spacing: 2px; color:#007c3e; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style=\"color: red;\">2</span>| Data Cleaning and Preparation</p>\n\n<div style='background-color: #fff7f7; border: 3px solid Red;'>\n    <font size=\"+1\" color=\"Red\">\n        <b>Please Upvote my notebook if you like my work.\n        <span style='color: green;'>Let's Support Each Other</span></b>\n    </font>\n</div>\n\n\n","metadata":{}},{"cell_type":"markdown","source":"<div style='background-color: #fff7f7; border: 2px solid '>\n    <font size=\"+2\" color=\"green\" ><b>🔴Import Libraries 📦</b></font>\n</div>","metadata":{}},{"cell_type":"code","source":"#Import Library\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n%matplotlib inline\nimport seaborn as sns\nimport warnings \nwarnings.filterwarnings('ignore')\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:49.730769Z","iopub.execute_input":"2023-08-18T01:12:49.731226Z","iopub.status.idle":"2023-08-18T01:12:49.738754Z","shell.execute_reply.started":"2023-08-18T01:12:49.731192Z","shell.execute_reply":"2023-08-18T01:12:49.737506Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style='background-color: #fff7f7; border: 2px solid '>\n    <font size=\"+2\" color=\"green\" ><b>🔴Load Dataset 🗂️</b></font>\n</div>","metadata":{}},{"cell_type":"code","source":"#Load Dataset\ndf = pd.read_csv('/kaggle/input/countries-of-the-world-2023/world-data-2023.csv')","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:49.741271Z","iopub.execute_input":"2023-08-18T01:12:49.741773Z","iopub.status.idle":"2023-08-18T01:12:49.776808Z","shell.execute_reply.started":"2023-08-18T01:12:49.741739Z","shell.execute_reply":"2023-08-18T01:12:49.775689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n<div style='background-color: #fff7f7; border: 2px solid '>\n    <font size=\"+2\" color=\"green\" ><b>🔴Data Type Conversion 🔄</b></font>\n</div>","metadata":{}},{"cell_type":"code","source":"# Data Type Conversion:\n# Columns to convert to float\ncolumns_to_convert = ['Density\\n(P/Km2)', 'Agricultural Land( %)', 'Land Area(Km2)',\n                      'Birth Rate', 'Co2-Emissions', 'Forested Area (%)',\n                      'CPI', 'CPI Change (%)', 'Fertility Rate', 'Gasoline Price', 'GDP',\n                      'Gross primary education enrollment (%)', 'Armed Forces size',\n                      'Gross tertiary education enrollment (%)', 'Infant mortality',\n                      'Life expectancy', 'Maternal mortality ratio', 'Minimum wage', \n                      'Out of pocket health expenditure', 'Physicians per thousand', \n                      'Population', 'Population: Labor force participation (%)', \n                      'Tax revenue (%)', 'Total tax rate', 'Unemployment rate', 'Urban_population']\n\n# Convert columns using a lambda function\ndf[columns_to_convert] = df[columns_to_convert].applymap(lambda x: float(str(x).replace(',', '').replace('$', '').replace('%', '')))\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:49.778674Z","iopub.execute_input":"2023-08-18T01:12:49.779112Z","iopub.status.idle":"2023-08-18T01:12:49.818571Z","shell.execute_reply.started":"2023-08-18T01:12:49.779047Z","shell.execute_reply":"2023-08-18T01:12:49.817408Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style='background-color: #fff7f7; border: 2px solid '>\n    <font size=\"+2\" color=\"green\" ><b>🔴Handling missing values 🧮</b></font>\n</div>","metadata":{}},{"cell_type":"code","source":"# List of columns with missing values\ncolumns_with_missing = df.columns[df.isnull().any()]\n\n# Impute numerical columns with mean\nnumerical_columns = df.select_dtypes(include=['float64'])\nnumerical_columns = numerical_columns.columns[numerical_columns.isnull().any()]\ndf[numerical_columns] = df[numerical_columns].fillna(df[numerical_columns].mean())\n\n# Impute categorical columns with mode\ncategorical_columns = df.select_dtypes(include=['object'])\ncategorical_columns = categorical_columns.columns[categorical_columns.isnull().any()]\ndf[categorical_columns] = df[categorical_columns].fillna(df[categorical_columns].mode().iloc[0])\n\n# Verify if all missing values are handled\nmissing_counts = df.isnull().sum()\nprint(missing_counts)","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:49.820036Z","iopub.execute_input":"2023-08-18T01:12:49.820514Z","iopub.status.idle":"2023-08-18T01:12:49.871893Z","shell.execute_reply.started":"2023-08-18T01:12:49.820481Z","shell.execute_reply":"2023-08-18T01:12:49.870634Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <p style=\" color: #ce0a0a; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); font-weight: bold; margin-bottom: 10px;font-size:140%;  background-color: #fff7f7; border: 3px solid \"><span style = 'color : red;'>2</span>| DATA VISUALIZATION 📊</p>\n\n    \n","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>3</span>| Top 20 Countries: Highest Unemployment</p>","metadata":{}},{"cell_type":"code","source":"sorted_df = df.sort_values(by = 'Unemployment rate', ascending = False)\n\ntop_high_unemployment = sorted_df.head(20)\ntop_low_unemployment = sorted_df.tail(20)\n\n# Create a figure with two subplots (side by side)\nfig, axes = plt.subplots(nrows=1, ncols=2, figsize=(14, 9))\n\n# Plot for high unemployment countries\nsns.barplot(data=top_high_unemployment, x='Country', y='Unemployment rate', palette='bright', ax=axes[0])\naxes[0].set_title('Top 20 High Unemployment Rate Countries')\naxes[0].set_xlabel('Country')\naxes[0].set_ylabel('Unemployment Rate')\naxes[0].set_xticklabels(axes[0].get_xticklabels(), rotation=45, ha='right')\nfor p in axes[0].patches:\n    axes[0].annotate(f'{p.get_height():.2f}%', (p.get_x() + p.get_width() / 2, p.get_height()),\n                     ha='center', va='bottom', fontsize=10, color='black', xytext=(0, 5),\n                     textcoords='offset points', rotation = 45)\n\n# Plot for low unemployment countries\nsns.barplot(data=top_low_unemployment, x='Country', y='Unemployment rate', palette='rainbow', ax=axes[1])\naxes[1].set_title('Top 20 Low Unemployment Rate Countries')\naxes[1].set_xlabel('Country')\naxes[1].set_ylabel('Unemployment Rate')\naxes[1].set_xticklabels(axes[1].get_xticklabels(), rotation=45, ha='right')\nfor p in axes[1].patches:\n    axes[1].annotate(f'{p.get_height():.2f}%', (p.get_x() + p.get_width() / 2, p.get_height()),\n                     ha='center', va='bottom', fontsize=10, color='black', xytext=(0, 5),\n                     textcoords='offset points', rotation = 45)\n\n# Show the plots\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:49.874801Z","iopub.execute_input":"2023-08-18T01:12:49.875489Z","iopub.status.idle":"2023-08-18T01:12:51.062008Z","shell.execute_reply.started":"2023-08-18T01:12:49.875455Z","shell.execute_reply":"2023-08-18T01:12:51.060207Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n\n<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n    \n**Top 20 Countries with Highest Unemployment Rates:**\nThe left plot displays the countries with the highest unemployment rates. South Africa has the highest unemployment rate at 28.18%, followed by Lesotho and Saint Lucia. The United States also appears on this list with a relatively high unemployment rate.\n\n**Top 20 Countries with Lowest Unemployment Rates:**\nThe right plot illustrates the countries with the lowest unemployment rates. These countries have remarkably low unemployment rates, with some even less than 1%. Qatar, Niger and Solomon islands, and Loas are among the countries with the lowest unemployment rates.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold;  color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>4</span>| Top 20 Countries: Highest Population</p>","metadata":{}},{"cell_type":"code","source":"import matplotlib.ticker as ticker\n\nsorted_df = df.sort_values(by='Population', ascending=False)\n\n# Get the top 20 countries with the highest population\ntop_population_country = sorted_df.head(20)\n\n# Set up the figure and axes for the subplots\nfig, axes = plt.subplots(nrows=1, ncols=1, figsize=(10, 7))\n\n# Plot for top population countries\nsns.barplot(data=top_population_country, x='Population', y='Country', palette='gist_rainbow_r', saturation=0.99, ax=axes)\naxes.set_title('Top 20 Countries with Highest Population')\naxes.set_xlabel('Population')\naxes.set_ylabel('Country')\naxes.set_xticklabels(['{:,}'.format(int(x)) for x in axes.get_xticks()], rotation = 40)\nfor p in axes.patches:\n    axes.annotate(f'{p.get_width():,.0f}', (p.get_width(), p.get_y() + p.get_height() / 2),\n                     xytext=(5, 0), textcoords='offset points', ha='left', va='center', fontsize=10)\n\nplt.tight_layout()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:17:33.456227Z","iopub.execute_input":"2023-08-18T01:17:33.456706Z","iopub.status.idle":"2023-08-18T01:17:34.173862Z","shell.execute_reply.started":"2023-08-18T01:17:33.456671Z","shell.execute_reply":"2023-08-18T01:17:34.172783Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\n**Top 20 Countries with Highest Population:**\nThe  plot displays the top 20 countries with the highest populations. China and India have the two highest populations, with around 1.4 billion people each. The United States follows with over 320 million people.\n","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>5</span>| Top 20 Countries: Highest Birth Rates</p>","metadata":{}},{"cell_type":"code","source":"# Sort the dataframe by 'Birth Rate' column in descending order\nsorted_df = df.sort_values(by='Birth Rate', ascending=False)\n\n# Get the top 20 countries with the highest birth rates\ntop_country_birth = sorted_df.head(20)\n\n# Create a bar plot to visualize the top 20 countries with high birth rates\nplt.figure(figsize=(10, 6))\nsns.barplot(data=top_country_birth, x='Country', y='Birth Rate', palette='bright')\n\n# Add title and labels\nplt.title('Top 20 Countries with Highest Birth Rates')\nplt.xlabel('Country')\nplt.ylabel('Birth Rate')\n\n# Rotate x-axis labels for better readability\nplt.xticks(rotation=45, ha='right')\n\n# Display data labels on top of each bar\nfor index, value in enumerate(top_country_birth['Birth Rate']):\n    plt.text(index, value, f'{value:.2f}', ha='center', va='bottom', fontsize=10, rotation = 45)\n\n# Show the plot\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:18:53.202117Z","iopub.execute_input":"2023-08-18T01:18:53.202625Z","iopub.status.idle":"2023-08-18T01:18:53.710574Z","shell.execute_reply.started":"2023-08-18T01:18:53.202591Z","shell.execute_reply":"2023-08-18T01:18:53.709553Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\n**Countries with Highest Birth Rates:**\nThis visualization highlights the top 20 countries with the highest birth rates. Niger has the highest birth rate at 46.08 births per 1000 people, followed by Mali and the Democratic Republic of the Congo.\nIt gives us insight into the population growth dynamics in these nations.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold;  color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>6</span>| Top 20 Countries: Highest Agricultural</p>","metadata":{}},{"cell_type":"code","source":"# Sort the dataframe by 'Agricultural Land (%)' column in descending order\nsorted_df = df.sort_values(by='Agricultural Land( %)', ascending=False)\n\n# Get the top 20 countries with the highest agricultural land percentages\ntop_country_Agri = sorted_df.head(20)\n\n# Create a bar plot to visualize the top 20 countries with high agricultural land percentages\nplt.figure(figsize=(10, 6))\nsns.barplot(data=top_country_Agri, x='Country', y='Agricultural Land( %)', palette='cool')\n\n# Add title and labels\nplt.title('Top 20 Countries with Highest Agricultural Land Percentage')\nplt.xlabel('Country')\nplt.ylabel('Agricultural Land (%)')\n\n# Rotate x-axis labels for better readability\nplt.xticks(rotation=40,fontweight = 'bold',fontsize = 10 )\n\n# Annotate the bars with actual values\nfor index, value in enumerate(top_country_Agri['Agricultural Land( %)']):\n    plt.text(index, value, f'{value:.2f}%', ha='center', va='bottom', fontsize=10 , rotation = 45)\n\n\n# Show the plot\nplt.show()\n","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2023-08-18T01:19:52.290474Z","iopub.execute_input":"2023-08-18T01:19:52.290902Z","iopub.status.idle":"2023-08-18T01:19:52.841697Z","shell.execute_reply.started":"2023-08-18T01:19:52.290869Z","shell.execute_reply":"2023-08-18T01:19:52.840705Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\n- **Countries with Most Farming Land:**\nThis graph shows the top 20 countries that use the most land for farming. Uruguay is at the top with 82.6% of its land used for agriculture. Saudi Arabia and Kazakhstan are also high on the list.\n\n- **Agricultural Land Across Countries:**\nThe chart helps us compare how much land each country uses for farming. Uruguay leads, followed by Saudi Arabia and Kazakhstan. This tells us how much land is dedicated to farming in each of these countries.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold;color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>7</span>| Top 20 Countries: Largest Armed Forces</p>","metadata":{}},{"cell_type":"code","source":"# Sort the DataFrame by 'Armed Forces size' column in descending order\nsorted_df = df.sort_values(by='Armed Forces size', ascending=False)\n\n# Get the top 20 countries with the largest armed forces sizes\ntop10 = sorted_df.head(20)\n\n# Create a bar plot to visualize the top 20 countries with the largest armed forces sizes\nsns.barplot(data=top10, x='Country', y='Armed Forces size', palette='nipy_spectral')\n\n# Add title and labels\nplt.title('Top 20 Countries with Largest Armed Forces Sizes')\nplt.xlabel('Country')\nplt.ylabel('Armed Forces Size')\n\n# Rotate x-axis labels for better readability\nplt.xticks(rotation=45, ha='right')\n\n# Annotate the bars with actual values\nfor index, value in enumerate(top10['Armed Forces size']):\n    plt.text(index, value, f'{value:.0f}', ha='center', va='bottom', fontsize=10, rotation=90)  # Rotate text\n\n# Show the plot\nplt.tight_layout()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:20:42.858093Z","iopub.execute_input":"2023-08-18T01:20:42.858541Z","iopub.status.idle":"2023-08-18T01:20:43.478605Z","shell.execute_reply.started":"2023-08-18T01:20:42.858509Z","shell.execute_reply":"2023-08-18T01:20:43.477610Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\n**Top 20 Countries with Largest Armed Forces Sizes:**\n\nThe  graph shows the sizes of the armies in the top 20 countries. India has the biggest army, followed by China, Russia, United States and pakistan. This graph helps us see how different these countries' armies are.\n\n","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>8</span>| Top 20 Countries: Largest Land Areas</p>","metadata":{}},{"cell_type":"code","source":"# Step 02: Sort the dataframe by 'Land Area(Km2)' column in descending order\nsorted_df = df.sort_values(by='Land Area(Km2)', ascending=False)\n\n# Step 03: Get the top 20 countries with the largest land areas\ntop_land_area_countries = sorted_df.head(20)\ntop_land_vs_population_countries = sorted_df.head(20)\n# Create subplots for both bar plot and scatter plot\n\n# Bar plot of top countries with largest land areas\nsns.barplot(data=top_land_area_countries, x='Country', y='Land Area(Km2)', palette='gist_rainbow')\nplt.title('Top 20 Countries with Largest Land Areas')\nplt.xlabel('Country')\nplt.ylabel('Land Area (Km²)')\nplt.xticks(rotation = 90)\n\n# Show the plots\n\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:21:40.709768Z","iopub.execute_input":"2023-08-18T01:21:40.710798Z","iopub.status.idle":"2023-08-18T01:21:41.201307Z","shell.execute_reply.started":"2023-08-18T01:21:40.710745Z","shell.execute_reply":"2023-08-18T01:21:41.200134Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe visualization showcases the land area distribution of the top 20 countries, highlighting Russia as the leader with the largest land area, followed by Canada, the United States, and China. This graphical representation effectively illustrates the significant geographical extent of these nations compared to others.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold;color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>9</span>| Top 20 Countries: Highest CO2 Emissions</p>","metadata":{}},{"cell_type":"code","source":"# Sort the DataFrame by CO2 emissions column in descending order and get the top 20 rows\ntop_co2_emissions_countries = df.sort_values(by='Co2-Emissions', ascending=False).head(20)\n\n# Create a bar plot to visualize CO2 emissions for top countries\nsns.barplot(data=top_co2_emissions_countries, x='Country', y='Co2-Emissions', palette='gist_rainbow_r')\nplt.title('Top 20 Countries with Highest CO2 Emissions')\nplt.xlabel('Country')\nplt.ylabel('CO2 Emissions')\nplt.xticks(rotation=45, ha='right')\n\nfor index , value in enumerate(top_co2_emissions_countries['Co2-Emissions']):\n    # plt.text(index, value, f'{value:.0f}', ha = 'center',va = 'bottom', fontsize = 10, rotation = 45)\n    plt.text(index, value,f'{value:.0f}',ha = 'center',va = 'bottom', fontsize = 10, rotation = 90)\nplt.tight_layout()\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:22:27.412638Z","iopub.execute_input":"2023-08-18T01:22:27.413841Z","iopub.status.idle":"2023-08-18T01:22:28.014898Z","shell.execute_reply.started":"2023-08-18T01:22:27.413801Z","shell.execute_reply":"2023-08-18T01:22:28.013810Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe bar plot showcases the top 20 countries with the highest CO2 emissions. China has the highest CO2 emissions, followed by the United States and India. This visualization highlights the significant carbon dioxide emissions from these countries, indicating their impact on global environmental concerns such as climate change.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>10</span>| Top 20 Countries: Low Infant Mortality</p>","metadata":{}},{"cell_type":"code","source":"# Sort the DataFrame by infant mortality column in ascending order and get the top 20 rows\ntop_infant_mortality_countries = df.sort_values(by='Infant mortality', ascending=True).head(20)\n\n# Create a bar plot to visualize infant mortality rates for top countries\nsns.barplot(data=top_infant_mortality_countries, x='Country', y='Infant mortality', palette='bright')\nplt.title('Top 20 Countries with Lowest Infant Mortality Rates')\nplt.xlabel('Country')\nplt.ylabel('Infant Mortality Rate')\nplt.xticks(rotation=90, ha='right')\n\nfor index, value in enumerate(top_infant_mortality_countries['Infant mortality']):\n    plt.text(index, value, f'{value}', ha='center', va='bottom', fontsize=10)  # Rotate text\n  \n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:22:52.757339Z","iopub.execute_input":"2023-08-18T01:22:52.757792Z","iopub.status.idle":"2023-08-18T01:22:53.637493Z","shell.execute_reply.started":"2023-08-18T01:22:52.757757Z","shell.execute_reply":"2023-08-18T01:22:53.636266Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nBar graph to show the 20 countries with the lowest rates (between 1.2 and 2.9 for every 1000 babies). This helps us see which countries are doing well in keeping babies healthy and where there's room for improvement.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>11</span>| Top 10 Countries:High Infant Mortality</p>","metadata":{}},{"cell_type":"code","source":"top_infant_mortality = df.sort_values(by='Infant mortality', ascending=False).head(20)\nsns.barplot(x='Infant mortality', y='Country', data=top_infant_mortality)\nplt.title('Top 10 Countries with Highest Infant Mortality')\nplt.xticks(rotation=90)\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:55.323678Z","iopub.execute_input":"2023-08-18T01:12:55.324020Z","iopub.status.idle":"2023-08-18T01:12:55.804346Z","shell.execute_reply.started":"2023-08-18T01:12:55.323992Z","shell.execute_reply":"2023-08-18T01:12:55.803228Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nHigh infant mortality rates (50.6 to 80.0 per 1000 live births) reveal healthcare disparities among the top 10 countries. Urgent action and international collaboration are needed to improve conditions and reduce these rates.","metadata":{}},{"cell_type":"markdown","source":"  # <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>12</span>| Top 20 Countries: Highest GDP</p>","metadata":{}},{"cell_type":"code","source":"# Sort the DataFrame by GDP column in descending order and get the top 20 rows\ntop_gdp_countries = df.sort_values(by='GDP', ascending=False).head(20)\n\n# Create a bar plot to visualize GDP for top countries\nsns.barplot(data=top_gdp_countries, x='Country', y='GDP', palette='cool_r')\nplt.title('Top 20 Countries with Highest GDP')\nplt.xlabel('Country')\nplt.ylabel('GDP')\nplt.xticks(rotation=45, ha='right')\n\n\n\n\nplt.tight_layout()\nplt.show()\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:55.806116Z","iopub.execute_input":"2023-08-18T01:12:55.806640Z","iopub.status.idle":"2023-08-18T01:12:56.360394Z","shell.execute_reply.started":"2023-08-18T01:12:55.806589Z","shell.execute_reply":"2023-08-18T01:12:56.359164Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nA bar graph illustrates their GDP values, ranging from billions to trillions, showcasing leading economies.\nThe bar plot visualizes the top 20 countries with the highest Gross Domestic Product (GDP). The United States leads with the highest GDP, followed by China, Germany, and the United Kingdom, showcasing their significant economic strength. The graph offers a clear comparison of GDP values among these countries.","metadata":{}},{"cell_type":"markdown","source":"## \n# <p style=\"font-family:JetBrains Mono; font-weight:bold; letter-spacing: 2px; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>13</span>| Top 20 Countries: Highest Tertiary Education Enrollment Rates</p>","metadata":{}},{"cell_type":"code","source":"# Sort the DataFrame by gross tertiary education enrollment column in descending order and get the top 20 rows\ntop_tertiary_enrollment_countries = df.sort_values(by='Gross tertiary education enrollment (%)', ascending=False).head(20)\n\n# Create a bar plot to visualize tertiary education enrollment for top countries\nax = sns.barplot(data=top_tertiary_enrollment_countries, x='Gross tertiary education enrollment (%)', y='Country', palette='bright')\nplt.title('Top 20 Countries with Highest Tertiary Education Enrollment Rates')\nplt.xlabel('Tertiary Education Enrollment (%)')\nplt.ylabel('Country')\nplt.xticks(rotation=45, ha='right')\n\n# Annotate each bar with the exact tertiary enrollment value using plt.text\nfor index, value in enumerate(top_tertiary_enrollment_countries['Gross tertiary education enrollment (%)']):\n    ax.text(value + 1, index, f'{value:.0f}', va='center', color='black')\n\nplt.tight_layout()\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:56.362386Z","iopub.execute_input":"2023-08-18T01:12:56.362831Z","iopub.status.idle":"2023-08-18T01:12:57.002412Z","shell.execute_reply.started":"2023-08-18T01:12:56.362792Z","shell.execute_reply":"2023-08-18T01:12:57.001052Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe bar plot visualizes the top 20 countries with the highest gross tertiary education enrollment rates. Notably, Greece holds the highest rate at 136.6%, followed by Australia, South Korea, and Argentina. The graph highlights the significant disparities in tertiary education enrollment across these nations, showcasing their dedication to higher education.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold;  color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>14</span>| Countries by Top Languages</p>","metadata":{}},{"cell_type":"code","source":"# Specify the number of top languages to display\ntop_languages_count = 10\n\n# Get the top N official languages\ntop_languages = df['Official language'].value_counts().nlargest(top_languages_count).index\n\n# Filter the DataFrame to include only the top languages\ndf_top_languages = df[df['Official language'].isin(top_languages)]\n\n# Count of Countries by Top Official Languages\nplt.figure(figsize=(8, 5))\nsns.countplot(data=df_top_languages, y='Official language', order=df_top_languages['Official language'].value_counts().index, palette='bright', saturation=0.8)\nplt.title('Count of Countries by Top Official Languages')\nplt.xlabel('Number of Countries')\nplt.ylabel('Official Language')\nplt.tight_layout()\n\n# Add annotations to the bars\nfor index, value in enumerate(df_top_languages['Official language'].value_counts()):\n    plt.text(value + 1, index, f'{value}', va='center')\n\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:57.003938Z","iopub.execute_input":"2023-08-18T01:12:57.004779Z","iopub.status.idle":"2023-08-18T01:12:57.440034Z","shell.execute_reply.started":"2023-08-18T01:12:57.004729Z","shell.execute_reply":"2023-08-18T01:12:57.439002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nGraphs showing the count of countries by top official languages:\n\n- French, English, and Spanish are the most common official languages among the top 10 countries.\n- Arabic and Portuguese are also widely spoken as official languages, each being the primary language in around 10 countries.\n- There are a few countries with None as their official language, which might indicate linguistic diversity or multilingualism.\n- Russian, Swahili, Persian, and Romanian are also represented, albeit in smaller numbers.\n\n","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>15</span>| Top 20 CPI Change (%): Currency Code</p>","metadata":{}},{"cell_type":"code","source":"# Select top N currencies with the highest CPI changes\ntop_n_currencies = 20\ntop_currencies = df.nlargest(top_n_currencies, 'CPI Change (%)')\n\n# Create the bar plot\nplt.figure(figsize=(8, 6))\nsns.set_palette(\"viridis\")  # Use a color palette for better distinction\nsns.barplot(x='CPI Change (%)', y='Currency-Code', data=top_currencies)\nplt.title('Top {} CPI Change (%) by Currency Code'.format(top_n_currencies))\nplt.xlabel('CPI Change (%)')\nplt.ylabel('Currency Code')\nplt.xticks(rotation=45)  # Rotate currency code labels for better readability\n\n# Add data labels to the bars\nfor index, value in enumerate(top_currencies['CPI Change (%)']):\n    plt.text(value + 0.5, index, f'{value:.2f}%', va='center')\n\n# Add horizontal grid lines\nplt.grid(axis='x', linestyle='--', alpha=0.7)\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:57.441276Z","iopub.execute_input":"2023-08-18T01:12:57.441587Z","iopub.status.idle":"2023-08-18T01:12:57.973952Z","shell.execute_reply.started":"2023-08-18T01:12:57.441560Z","shell.execute_reply":"2023-08-18T01:12:57.973133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nA bar graph displays these changes, ranging from 9.2% to 254.9%, revealing economic trends and variations among currencies.\n\nThe graph highlights varying CPI changes across currencies, indicating economic conditions and inflation trends. Currencies with high positive CPI changes might suggest inflationary pressures and economic growth, while negative changes could reflect deflationary concerns.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold;color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>16</span>| Urbanization Trends by Country</p>","metadata":{}},{"cell_type":"code","source":"subset_countries = 20  # Number of top countries to display\nurbanization_by_country = df.groupby('Country')['Urban_population'].mean().sort_values(ascending=False).head(subset_countries)\n\nplt.figure(figsize=(10, 8))\nax = urbanization_by_country.plot(kind='barh', color='skyblue')\nplt.title('Urbanization Trends by Country')\nplt.xlabel('Average Urban Population')\nplt.ylabel('Country')\nplt.gca().invert_yaxis()  # Invert y-axis to have the highest value at the top\n\n# Add data labels to the bars\nfor index, value in enumerate(urbanization_by_country):\n    ax.text(value + 2, index, f'{value:.2f}', va='center', color='black')  # Display values on a separate axis\n\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:57.975778Z","iopub.execute_input":"2023-08-18T01:12:57.976147Z","iopub.status.idle":"2023-08-18T01:12:58.522532Z","shell.execute_reply.started":"2023-08-18T01:12:57.976112Z","shell.execute_reply":"2023-08-18T01:12:58.521352Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nNotable entries include China with around 842 million, India with about 471 million, and the United States with approximately 270 million urban inhabitants.\n\nThe bar chart highlights the top countries with the highest average urban populations. China, India, and the United States lead, each with urban populations exceeding hundreds of millions, while Brazil, Indonesia, and Russia follow closely in terms of urbanization.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold;color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>17</span>| Population Density Distribution</p>","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(9, 6))\nplt.hist(df['Density\\n(P/Km2)'], bins=20, color='skyblue', edgecolor='red')\nplt.title('Population Density Distribution')\nplt.xlabel('Population Density (P/Km²)')\nplt.ylabel('Frequency')\nplt.grid(True)\nplt.tight_layout()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:58.523934Z","iopub.execute_input":"2023-08-18T01:12:58.524291Z","iopub.status.idle":"2023-08-18T01:12:58.976827Z","shell.execute_reply.started":"2023-08-18T01:12:58.524260Z","shell.execute_reply":"2023-08-18T01:12:58.975585Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe histogram indicates that a higher number of countries have relatively lower population densities, while fewer countries have higher population densities exceeding 1000 people per square kilometer. This is evident from the taller bars in the lower range of population density values compared to the higher values, which leads to the right-skewed distribution.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>18</span>| Distribution of Life Expectancy</p>","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(9, 6))\nsns.histplot(data=df, x='Life expectancy', bins=20, kde=True, color='Orange')\nplt.title('Distribution of Life Expectancy')\nplt.xlabel('Life Expectancy')\nplt.ylabel('Frequency')\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:58.978431Z","iopub.execute_input":"2023-08-18T01:12:58.978866Z","iopub.status.idle":"2023-08-18T01:12:59.357271Z","shell.execute_reply.started":"2023-08-18T01:12:58.978834Z","shell.execute_reply":"2023-08-18T01:12:59.356030Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe distribution of life expectancy is skewed to the left, with a peak around 75-80 years. Most countries have life expectancies between 60 and 85 years.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>18</span>| Distribution of Birth Rates</p>","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nplt.hist(df['Birth Rate'], bins=20, color='lightblue', edgecolor='black')\nplt.title('Distribution of Birth Rates')\nplt.xlabel('Birth Rate')\nplt.ylabel('Frequency')\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:59.358866Z","iopub.execute_input":"2023-08-18T01:12:59.359229Z","iopub.status.idle":"2023-08-18T01:12:59.911342Z","shell.execute_reply.started":"2023-08-18T01:12:59.359199Z","shell.execute_reply":"2023-08-18T01:12:59.910121Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe histogram of birth rates indicates a skewed distribution, with fewer countries having higher birth rates and a larger proportion having lower birth rates.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold;  color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>19</span>| Urban Population Distribution:</p>","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nsns.histplot(df['Urban_population'], bins=50)\nplt.title('Urban Population Distribution')\nplt.xlabel('Urban Population')\nplt.ylabel('Frequency')\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:12:59.912508Z","iopub.execute_input":"2023-08-18T01:12:59.912841Z","iopub.status.idle":"2023-08-18T01:13:00.317460Z","shell.execute_reply.started":"2023-08-18T01:12:59.912814Z","shell.execute_reply":"2023-08-18T01:13:00.315136Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe urban population distribution exhibits a right-skewed pattern, with a higher concentration of countries having smaller urban populations.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>20</span>| Distribution of Currency Codes</p>","metadata":{}},{"cell_type":"code","source":"# Get the top N currency codes (e.g., top 10)\ntop_n_currency = 10\ncurrency_counts = df['Currency-Code'].value_counts().head(top_n_currency)\n\n# Calculate the sum of remaining counts\nremaining_counts = df['Currency-Code'].value_counts().sum() - currency_counts.sum()\n\n# Create a new Series for the top currency codes and an \"Other\" category\ncurrency_counts = currency_counts.append(pd.Series([remaining_counts], index=['Other']))\n\n# Plot the pie chart\ncolor = ['red', 'green', 'blue', 'cyan','orange','grey']\nplt.pie(currency_counts, labels=currency_counts.index, autopct='%1.1f%%', startangle=140, colors=sns.color_palette(\"rainbow_r\"))\nplt.title('Distribution of Currency Codes')\nplt.axis('equal')\nplt.tight_layout()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:13:00.318801Z","iopub.execute_input":"2023-08-18T01:13:00.319133Z","iopub.status.idle":"2023-08-18T01:13:00.685603Z","shell.execute_reply.started":"2023-08-18T01:13:00.319105Z","shell.execute_reply":"2023-08-18T01:13:00.684023Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe currency distribution includes EUR (19.5%), XOF (4.1%), XAF (3.1%), USD (3.1%) etc , and others (63.1%).","metadata":{}},{"cell_type":"markdown","source":"## \n\n# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>21</span>| Economic Indicators Scatter Matrix:</p>","metadata":{}},{"cell_type":"code","source":"economic_indicators = df[['GDP', 'Gross primary education enrollment (%)', 'Total tax rate', 'Unemployment rate']]\nsns.pairplot(economic_indicators)\nplt.suptitle('Scatter Plot Matrix of Key Economic Indicators', y=1.02)\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:13:00.688038Z","iopub.execute_input":"2023-08-18T01:13:00.689102Z","iopub.status.idle":"2023-08-18T01:13:06.252573Z","shell.execute_reply.started":"2023-08-18T01:13:00.689029Z","shell.execute_reply":"2023-08-18T01:13:06.251375Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThe pair plot indicating potential correlations and trends in economic indicators.","metadata":{}},{"cell_type":"markdown","source":"\n# <p style=\"font-family:JetBrains Mono; font-weight:bold;color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>22</span>| Birth Rate vs GDP</p>","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10, 6))\nplt.scatter(df['GDP'], df['Birth Rate'], color='purple', alpha=0.5)\nplt.title('Birth Rate vs GDP')\nplt.xlabel('GDP')\nplt.ylabel('Birth Rate')\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:13:06.253851Z","iopub.execute_input":"2023-08-18T01:13:06.254216Z","iopub.status.idle":"2023-08-18T01:13:06.530169Z","shell.execute_reply.started":"2023-08-18T01:13:06.254185Z","shell.execute_reply":"2023-08-18T01:13:06.529038Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n<font size=\"+3\" color='#059c99'><b> ✨Insights 😃😃 </b></font>\n\nThis trend indicates that countries with lower GDPs tend to have higher birth rates, possibly influenced by socio-economic factors and development status.","metadata":{}},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>23 </span>| Global Distribution of Countries</p>","metadata":{}},{"cell_type":"code","source":"import geopandas as gpd\nfrom shapely.geometry import Point\n\n# Create GeoDataFrame\ngeometry = [Point(xy) for xy in zip(df['Longitude'], df['Latitude'])]\ngdf = gpd.GeoDataFrame(df, geometry=geometry, crs='EPSG:4326')\n\n# World map\nworld = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\nfig, ax = plt.subplots(figsize=(10, 6))\n\n# Plot world map\nworld.plot(ax=ax, color='lightgrey', edgecolor='black')\n\n# Plot country points with a color map\nscatter = gdf.plot(ax=ax, markersize=100, legend=True, cmap='Set2', alpha=0.5, categorical=True, legend_kwds={'bbox_to_anchor': (1, 1)})\n\n# Annotate country names\nfor x, y, label in zip(gdf.geometry.x, gdf.geometry.y, gdf['Country']):\n    if label in ['United States of America', 'Canada', 'Russia',\n                 'China', 'Australia','Pakistan','India','Brazil', 'Kazakhstan','Algeria', 'Saudi Arabia']:\n        ax.text(x, y, label.split(' ')[0], fontsize=8, ha='right', color='black', weight='bold', alpha=0.9)\n    else:\n        ax.text(x, y, '', fontsize=8, ha='right', color='darkslategrey', weight='bold', alpha=0.7)\n\n# Set a title\nplt.title('Global Distribution of Countries', fontsize=16, fontweight='bold')\n\n\n\n\n\n# Display the plot\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-08-18T01:13:06.531704Z","iopub.execute_input":"2023-08-18T01:13:06.532193Z","iopub.status.idle":"2023-08-18T01:13:07.628578Z","shell.execute_reply.started":"2023-08-18T01:13:06.532151Z","shell.execute_reply":"2023-08-18T01:13:07.627321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# <p style=\"font-family:JetBrains Mono; font-weight:bold; color:Green; font-size:140%; text-align:left;padding: 0px; border-bottom: 3px solid #FFC67D\"><span style = 'color : red;'>24 </span>| Conclusion</p>","metadata":{}},{"cell_type":"markdown","source":"<div style=\"border-radius:10px; border:#24e7f2 solid ; padding: 15px; background-color: #F3f9ed; font-size:100%; text-align:left\">\n    \n<font size=\"+3\" color='#059c99'><b> ✨Conclusion 😃😃 </b></font>\n\nThe compilation of visualizations offers a comprehensive panorama of diverse facets in different countries, granting insights into their economic, demographic, and environmental realms:\n\n### 🌐 Unemployment Rates\nFrom countries grappling with high unemployment rates like Gabon to those enjoying remarkably low rates such as Germany, these visualizations underline the varied state of global labor markets.\n\n### 🌍 Population Dynamics\nChina and India emerge as demographic behemoths, while the visual representation showcases the profound contrasts in population sizes across nations.\n\n### 🌱 Birth Rates and Urbanization\nThrough the spotlight on countries with elevated birth rates like Niger, the data elucidates population growth dynamics. Furthermore, urbanization trends come to the fore, delineating nations with substantial urban populations.\n\n### 🌾 Agriculture and Armed Forces\nUruguay's extensive agricultural land and the magnitude of armed forces in countries like India, China, and the United States underscore their prioritization of these domains.\n\n### 🌍 CO2 Emissions and Environmental Impact\nThe juxtaposition of CO2 emissions in China, the United States, and India underscores their momentous contributions to global environmental concerns.\n\n### 💰 Economic Strength and GDP\nThe GDP visualization showcases economic powerhouses like the United States and China, magnifying their significant economic sway.\n\n### 📚 Tertiary Education Priorities\nGreece's robust tertiary education enrollment rate and the disparities across countries underscore their dedication to higher learning.\n\n### 🌎 Linguistic Diversity\nThe linguistic landscape visualization unveils the prevalence of official languages such as French, English, and Spanish, while simultaneously showcasing the tapestry of linguistic diversity.\n\n### 💱 Currency Trends and Inflation\nThe depiction of CPI changes among currencies furnishes insights into economic climates and patterns of inflation.\n\n### 🏙 Urban Population\nChina, India, and the United States command the lead in urban populations, evincing varying degrees of urbanization.\n\n### 🏞 Population Density and Life Expectancy\nThe histogram on population density encapsulates a spectrum of densities, while the distribution of life expectancy shines a light on health conditions across nations.\n\n### 📊 GDP and CO2 Emissions Relationship\nThe connection between GDP and CO2 emissions underscores the interrelationship between economic prosperity and environmental challenges.\n\n### 📈 Correlations and Economic Trends\nThe pair plot charts potential correlations and trends within economic indicators, enriching the analytical depth.\n\n### 📉 GDP and Birth Rates Relationship\nThe interplay between GDP and birth rates suggests the intricate influence of economic factors on population dynamics.\n","metadata":{}},{"cell_type":"markdown","source":"  <div style=\"margin-left: 20px;\">\n         <img src=\"https://i.gifer.com/XOsX.gif\" alt=\"Small Image\" style=\"width: 100px; height: auto;\">\n      </div>🔴","metadata":{}},{"cell_type":"markdown","source":"<font size=\"+2\" color=red ><b>Please Upvote my notebook if you like my work. <br><span style = 'color: Blue;'>Let's Support Each Other.</span></b></font>\n\n<center><a href=\"https://www.buymeacoffee.com/zabih\" target=\"_blank\"><img src=\"https://www.codehim.com/wp-content/uploads/2022/09/bmc-button-640x180.png.webp\" alt=\"Buy Me A Coffee\" style=\"height: 100px; width: 400px; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a></center>\n\n","metadata":{}}]}