Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- import sqlite3
- from sqlite3 import Error
- def create_con(db_name):
- try:
- cursor = sqlite3.connect(db_name)
- except Error as e:
- print(e)
- def grab_data(connection):
- cursor = connection.cursor()
- cursor.execute("SELECT * FROM Country")
- data = {}
- rows = cursor.fetchall()
- for ind, row in rows:
- data[ind] = row
- return data
- x = ['France', 'Iran', 'Russia', 'Japan', 'China', 'USA']
- y = [503, 32, 34223, 2343, 23, 211]
- plt.ticklabel_format(style='sci', axis='y', scilimits=(0, 0))
- plt.bar(x, y)
- plt.ylabel('Hackers Value')
- plt.xlabel('Country')
- plt.title('Top 25 Countries for Hackers')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement