Visualizing companies and its profits in 2000, according to Forbes magazine
In [1]:
# Visualizing companies and its profits in 2000, according to Forbes magazine.
In [2]:
import numpy as np
import pandas as pd
from collections import Counter
from pandas import Series, DataFrame
In [3]:
# Reading the file:
data = pd.read_csv('Forbes2000.csv', nrows=20, index_col=0)
data
Out[3]:
In [4]:
# Extracting company names and its profits:
company_names = data['name']
company_profits = data['profits']
print(company_names)
In [5]:
print(company_profits)
In [6]:
# Visualizing the data:
import matplotlib.pyplot as plt
In [9]:
plt.style.use("ggplot")
plt.figure(figsize=(14, 14))
plt.barh(company_names, company_profits)
plt.title("Companies.Forbes 2000")
#plt.ylabel("Companies")
plt.xlabel("Profits")
plt.show()
In [8]:
# We can see that ExxonMobil and Citigroup, were two of the most profitable companies in 2000.
Comments
Post a Comment