join the Figure Friday session on December 6, at noon Eastern Time, to showcase your creation and receive feedback from the community.
Did you know that in 2018 98% of the population in Bahrain was using the internet, while in Brazil it was 70% and in Bolivia it was 44%?
In this week’s Figure-Friday we’ll look at the Worldbank’s data on Individuals using the Internet (as a % of the population). It’s important to note that internet users are defined as individuals who have used the Internet (from any location) in the last 3 months. (The Internet can be used via a computer, mobile phone, personal digital assistant, games machine, digital TV etc.)
Things to consider:
- can you improve the sample figure below (line chart docs)?
- would a different figure tell the data story better?
- can you create a Dash app instead?
Sample figure:
Code for sample figure:
import plotly.express as px
import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/plotly/Figure-Friday/refs/heads/main/2024/week-48/API_IT.NET.USER.ZS_DS2_en_csv_v2_2160.csv")
df_filtered = df[df["Country Name"].isin(["Angola", "Albania", "Andorra", "Argentina"])]
melted_data = pd.melt(
df_filtered,
id_vars=['Country Name'],
var_name='Year',
value_name='Quantity'
)
melted_data['Year'] = pd.to_numeric(melted_data['Year'], errors='coerce')
# Drop rows where 'Year' is NaN (non-year columns) or 'Quantity' is NaN
melted_data = melted_data.dropna(subset=['Year', 'Quantity'])
print(melted_data)
fig = px.line(melted_data, y="Quantity", x="Year", color="Country Name", markers=True)
fig.update_layout(hovermode='x unified')
fig.show()
Participation Instructions:
- Create - use the weekly data set to build your own Plotly visualization or Dash app. Or, enhance the sample figure provided in this post, using Plotly or Dash.
- Submit - post your creation to LinkedIn or Twitter with the hashtags
#FigureFriday
and#plotly
by midnight Thursday, your time zone. Please also submit your visualization as a new post in this thread. - Celebrate - join the Figure Friday sessions to showcase your creation and receive feedback from the community.
If you prefer to collaborate with others on Discord, join the Plotly Discord channel.
Data Source:
Thank you to the WorldBank for the data.