Popcorn hack1: I chose answers B and D because the other two dont make sense
Digital Divide Homework
DOWNLOAD AND COPY THIS NOTEBOOK TO YOUR PERSONAL REPOSITORY
Download and extract this dataset from kaggle and move it into the same folder as this notebook.
All the preprocessing has been done for you, and the unneeded columns have been dropped. Your task is to loop through the Rate (WB) column and print the country name associated with the percentage, the percentage, and “doing great” if the percentage is above 70% or “needs improvement” if not above 70%.
For example, 18.4% of people in Afghanistan have access to the internet (According to data from the World Bank), so you would print “Afghanistan: 18.4: Needs improvement”
On the other hand, Albania has 83.1% internet access so you would print “Albania: 83.1%: doing great”
import pandas as pd
data = pd.read_csv("internet_users.csv").drop(columns=['Notes', 'Year.2', 'Users (CIA)', 'Rate (ITU)', 'Year.1']) # Drop extra columns: we will not be using these
data_cleaned = data.dropna() # Drop rows with NaN (aka blank) values
print(data_cleaned.head()) # Display the first few rows of the cleaned data
#print(len(data)) # Check num of rows before removing blank rows
#print(len(data_cleaned)) # Check num of rows after removing blank rows
Location Rate (WB) Year
0 World 67.4 2023.0
1 Afghanistan 18.4 2020.0
2 Albania 83.1 2023.0
3 Algeria 71.2 2022.0
5 Andorra 94.5 2022.0
y = data_cleaned['Rate (WB)'] # Take Percentage of the population using the internet from World Bank data in dataset
name = data_cleaned['Location'] # take contry name from WB data in dataset
for country, rate in zip(name, y):
status = "Doing great" if rate > 70 else "Needs improvement"
print(f"{country}: {rate}%: {status}")
World: 67.4%: Needs improvement
Afghanistan: 18.4%: Needs improvement
Albania: 83.1%: Doing great
Algeria: 71.2%: Doing great
Andorra: 94.5%: Doing great
Angola: 39.3%: Needs improvement
Antigua and Barbuda: 91.4%: Doing great
Argentina: 89.2%: Doing great
Armenia: 78.6%: Doing great
Aruba: 97.2%: Doing great
Australia: 95.0%: Doing great
Austria: 95.3%: Doing great
Azerbaijan: 88.0%: Doing great
Bahamas: 94.4%: Doing great
Bahrain: 100.0%: Doing great
Bangladesh: 44.5%: Needs improvement
Barbados: 76.2%: Doing great
Belarus: 91.5%: Doing great
Belgium: 94.6%: Doing great
Belize: 70.4%: Doing great
Benin: 33.8%: Needs improvement
Bermuda: 98.4%: Doing great
Bhutan: 86.8%: Doing great
Bolivia: 73.3%: Doing great
Bosnia and Herzegovina: 83.4%: Doing great
Botswana: 77.3%: Doing great
Brazil: 84.2%: Doing great
British Virgin Islands: 77.7%: Doing great
Brunei: 99.0%: Doing great
Bulgaria: 80.4%: Doing great
Burkina Faso: 19.9%: Needs improvement
Burundi: 11.3%: Needs improvement
Cambodia: 56.7%: Needs improvement
Cameroon: 43.9%: Needs improvement
Canada: 94.6%: Doing great
Cape Verde: 72.1%: Doing great
Cayman Islands: 81.1%: Doing great
Central African Republic: 10.6%: Needs improvement
Chad: 12.2%: Needs improvement
Chile: 94.1%: Doing great
China: 77.5%: Doing great
Colombia: 73.0%: Doing great
Comoros: 27.3%: Needs improvement
Costa Rica: 85.1%: Doing great
Croatia: 83.2%: Doing great
Cuba: 73.2%: Doing great
Curacao: 68.1%: Needs improvement
Cyprus: 91.2%: Doing great
Czech Republic: 86.0%: Doing great
Democratic Republic of the Congo: 27.2%: Needs improvement
Denmark: 98.9%: Doing great
Djibouti: 65.0%: Needs improvement
Dominica: 83.4%: Doing great
Dominican Republic: 85.2%: Doing great
East Timor: 40.8%: Needs improvement
Ecuador: 72.7%: Doing great
Egypt: 72.2%: Doing great
El Salvador: 62.9%: Needs improvement
Equatorial Guinea: 66.8%: Needs improvement
Eritrea: 26.6%: Needs improvement
Estonia: 93.2%: Doing great
Eswatini: 58.3%: Needs improvement
Ethiopia: 19.4%: Needs improvement
Faroe Islands: 97.6%: Doing great
Fiji: 85.2%: Doing great
Finland: 93.5%: Doing great
France: 86.8%: Doing great
French Polynesia: 72.7%: Doing great
Gabon: 73.7%: Doing great
Gambia: 54.2%: Needs improvement
Georgia: 81.9%: Doing great
Germany: 92.5%: Doing great
Ghana: 69.8%: Needs improvement
Gibraltar: 94.4%: Doing great
Greece: 85.0%: Doing great
Greenland: 69.5%: Needs improvement
Grenada: 79.9%: Doing great
Guam: 80.5%: Doing great
Guatemala: 54.4%: Needs improvement
Guinea: 33.9%: Needs improvement
Guinea-Bissau: 31.6%: Needs improvement
Guyana: 85.3%: Doing great
Haiti: 39.3%: Needs improvement
Honduras: 59.7%: Needs improvement
Hong Kong: 95.6%: Doing great
Hungary: 91.5%: Doing great
Iceland: 99.9%: Doing great
India: 43.4%: Needs improvement
Indonesia: 69.2%: Needs improvement
Iran: 81.7%: Doing great
Iraq: 78.7%: Doing great
Ireland: 95.6%: Doing great
Israel: 91.9%: Doing great
Italy: 87.0%: Doing great
Ivory Coast: 43.8%: Needs improvement
Jamaica: 85.1%: Doing great
Japan: 93.2%: Doing great
Jordan: 90.5%: Doing great
Kazakhstan: 92.9%: Doing great
Kenya: 40.8%: Needs improvement
Kiribati: 54.4%: Needs improvement
Kosovo: 89.4%: Doing great
Kuwait: 99.8%: Doing great
Kyrgyzstan: 79.8%: Doing great
Laos: 66.2%: Needs improvement
Latvia: 92.2%: Doing great
Lebanon: 90.1%: Doing great
Lesotho: 47.0%: Needs improvement
Liberia: 30.1%: Needs improvement
Libya: 88.4%: Doing great
Liechtenstein: 99.6%: Doing great
Lithuania: 88.5%: Doing great
Luxembourg: 99.4%: Doing great
Macao: 89.8%: Doing great
Madagascar: 20.6%: Needs improvement
Malawi: 27.7%: Needs improvement
Malaysia: 97.7%: Doing great
Maldives: 85.2%: Doing great
Mali: 33.1%: Needs improvement
Malta: 91.9%: Doing great
Marshall Islands: 73.2%: Doing great
Mauritania: 44.4%: Needs improvement
Mauritius: 75.5%: Doing great
Mexico: 81.2%: Doing great
Micronesia: 40.5%: Needs improvement
Moldova: 71.0%: Doing great
Monaco: 98.6%: Doing great
Mongolia: 83.9%: Doing great
Montenegro: 88.2%: Doing great
Morocco: 89.9%: Doing great
Mozambique: 21.2%: Needs improvement
Myanmar: 48.1%: Needs improvement
Namibia: 62.2%: Needs improvement
Nauru: 83.3%: Doing great
Nepal: 49.6%: Needs improvement
Netherlands: 97.0%: Doing great
New Caledonia: 82.0%: Doing great
New Zealand: 95.7%: Doing great
Nicaragua: 61.1%: Needs improvement
Niger: 16.9%: Needs improvement
Nigeria: 35.5%: Needs improvement
North Macedonia: 84.2%: Doing great
Norway: 99.0%: Doing great
Oman: 97.9%: Doing great
Pakistan: 33.0%: Needs improvement
Palestine: 88.7%: Doing great
Panama: 73.6%: Doing great
Papua New Guinea: 27.0%: Needs improvement
Paraguay: 78.1%: Doing great
Peru: 74.7%: Doing great
Philippines: 75.2%: Doing great
Poland: 86.9%: Doing great
Portugal: 85.8%: Doing great
Puerto Rico: 87.3%: Doing great
Qatar: 100.0%: Doing great
Republic of the Congo: 36.3%: Needs improvement
Romania: 89.2%: Doing great
Russia: 92.3%: Doing great
Rwanda: 34.4%: Needs improvement
Saint Kitts and Nevis: 76.5%: Doing great
Saint Lucia: 75.8%: Doing great
Saint Vincent and the Grenadines: 78.7%: Doing great
Samoa: 76.3%: Doing great
San Marino: 85.1%: Doing great
Sao Tome and Principe: 57.0%: Needs improvement
Saudi Arabia: 100.0%: Doing great
Senegal: 60.0%: Needs improvement
Serbia: 85.4%: Doing great
Seychelles: 86.7%: Doing great
Sierra Leone: 30.4%: Needs improvement
Singapore: 96.9%: Doing great
Slovakia: 89.9%: Doing great
Slovenia: 90.4%: Doing great
Solomon Islands: 47.3%: Needs improvement
Somalia: 27.6%: Needs improvement
South Africa: 74.7%: Doing great
South Korea: 97.6%: Doing great
South Sudan: 12.1%: Needs improvement
Spain: 95.5%: Doing great
Sri Lanka: 50.1%: Needs improvement
Sudan: 28.7%: Needs improvement
Suriname: 75.8%: Doing great
Sweden: 95.7%: Doing great
Switzerland: 97.3%: Doing great
Syria: 35.8%: Needs improvement
Tajikistan: 36.1%: Needs improvement
Tanzania: 31.9%: Needs improvement
Thailand: 89.5%: Doing great
Togo: 37.6%: Needs improvement
Tonga: 66.7%: Needs improvement
Trinidad and Tobago: 80.0%: Doing great
Tunisia: 73.8%: Doing great
Turkey: 86.0%: Doing great
Turkmenistan: 21.3%: Needs improvement
Tuvalu: 82.3%: Doing great
Uganda: 10.0%: Needs improvement
Ukraine: 79.2%: Doing great
United Arab Emirates: 100.0%: Doing great
United Kingdom: 95.3%: Doing great
United States: 97.1%: Doing great
Uruguay: 89.9%: Doing great
US Virgin Islands: 64.4%: Needs improvement
Uzbekistan: 89.0%: Doing great
Vanuatu: 69.9%: Needs improvement
Venezuela: 61.6%: Needs improvement
Vietnam: 78.6%: Doing great
Yemen: 26.7%: Needs improvement
Zambia: 31.2%: Needs improvement
Zimbabwe: 32.6%: Needs improvement
How it works: I added a for loop that iterates through the name (country) and y (internet usage rate) columns using zip(), which pairs each country with its corresponding internet usage rate. Inside the loop, a conditional statement (if rate > 70) determines whether the country is “Doing great” or “Needs improvement” and assigns the appropriate status. Finally, the print() function outputs the country name, internet usage percentage, and status in the required format.
Popcorn hack 2: How would you attempt to fix the didgital divide in our comunity or prevent it from being as prevalent in our cmmunity? what are some things that re a;ready being done? what are some things we can add? explain
Bridging the digital divide requires expanding affordable internet access, providing free public Wi-Fi, and ensuring people have access to devices through school and community programs. Current efforts include government-subsidized internet plans, digital literacy training, and public tech hubs, but more investment in rural broadband, low-cost internet options, and school-business partnerships can further close the gap. By improving infrastructure, education, and policy support, we can create a more digitally inclusive community
Submission Instructions
Link your notebook on your personal repository with all the code cells executed on this google form.
Also write a 3 sentence summary of what you added and HOW it works.