Skip to content

Instantly share code, notes, and snippets.

@karamanbk
Created May 3, 2019 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karamanbk/72a7848de3c3e3727b616941c2d223c1 to your computer and use it in GitHub Desktop.
Save karamanbk/72a7848de3c3e3727b616941c2d223c1 to your computer and use it in GitHub Desktop.
# import libraries
from datetime import datetime, timedelta
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from __future__ import division
import plotly.plotly as py
import plotly.offline as pyoff
import plotly.graph_objs as go
#inititate Plotly
pyoff.init_notebook_mode()
#load our data from CSV
tx_data = pd.read_csv('data.csv')
#convert the string date field to datetime
tx_data['InvoiceDate'] = pd.to_datetime(tx_data['InvoiceDate'])
#we will be using only UK data
tx_uk = tx_data.query("Country=='United Kingdom'").reset_index(drop=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment