Skip to content
Analyzing unicorn company data
DataFrameas
df
variable
select * from public.companies
import matplotlib.pyplot as plt
# Group the data by continent and count the number of companies in each continent
continent_counts = df.groupby("continent")["company_id"].count()
# Create a bar chart to visualize the data
plt.bar(continent_counts.index, continent_counts.values)
plt.xlabel("Continent")
plt.ylabel("Number of Companies")
plt.title("Number of Companies by Continent")
# Display the chart
plt.show()