Edward Lance Lorilla |
【ANDROID STUDIO】Periodic Work Request Work Manager Posted: 27 Jun 2021 07:17 AM PDT package com.example.wordmanager
package com.example.wordmanager |
【PYTHON】collect the data using a SQL query Posted: 27 Jun 2021 07:15 AM PDT engine = create_engine('sqlite:///chinook.db') query = """SELECT SUM(Total) as Total , strftime('%m-%Y', InvoiceDate) as 'month-year', BillingCountry FROM invoices WHERE BillingCountry="USA" GROUP BY strftime("%m-%Y", InvoiceDate); """ with engine.connect() as connection: sql_df2 = pd.read_sql_query(query, connection) sql_df2.head() # convert to datetime for better plotting sql_df2['month-year'] = pd.to_datetime(sql_df2['month-year']) sns.lineplot(data=sql_df2, x='month-year', y='Total', hue='BillingCountry') plt.xlabel('Year') |
You are subscribed to email updates from Edward Lance Lorilla. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment