Untitled
unknown
python
a year ago
1.5 kB
2
Indexable
Never
import pandas as pd # Load the CSV file into a Pandas DataFrame csv_path = "/path/to/your/csvfile.csv" df = pd.read_csv(csv_path) import sqlite3 # Connect to SQLite database (will be created if not exists) conn = sqlite3.connect('hires_database.db') cursor = conn.cursor() # Assuming your CSV has columns like: technology, year, seniority, country # Create table cursor.execute(''' CREATE TABLE hires ( id INTEGER PRIMARY KEY, technology TEXT, year INTEGER, seniority TEXT, country TEXT ) ''') # Insert data df.to_sql('hires', conn, if_exists='replace', index=False) conn.commit() import matplotlib.pyplot as plt # Hires by technology (pie chart) tech_counts = df['technology'].value_counts() tech_counts.plot(kind='pie', autopct='%1.1f%%') plt.title("Hires by Technology") plt.show() # Hires by year (horizontal bar chart) year_counts = df['year'].value_counts() year_counts.sort_index().plot(kind='barh') plt.title("Hires by Year") plt.show() # Hires by seniority (bar chart) seniority_counts = df['seniority'].value_counts() seniority_counts.plot(kind='bar') plt.title("Hires by Seniority") plt.show() # Hires by country over years (multiline chart) selected_countries = ['USA', 'Brazil', 'Colombia', 'Ecuador'] for country in selected_countries: country_data = df[df['country'] == country]['year'].value_counts().sort_index() plt.plot(country_data.index, country_data.values, label=country) plt.title("Hires by Country Over Years") plt.legend() plt.show()