Last active
May 2, 2020 08:16
-
-
Save anbento0490/2ad54c083d59e49b4cc27cafa4a35593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import yfinance as yf | |
orders = pd.read_csv('/Users/anbento/Documents/Data_Sets/Medium/customer_orders.csv', | |
parse_dates = ['order_date'], index_col = ['order_date'] ) | |
orders.insert(0, 'order_month', pd.DatetimeIndex(orders.index).to_period('M') ) | |
orders.reset_index(inplace = True) | |
orders.columns = ['Order Date', 'Order Month' ,'Order ID', 'Customer ID', 'Item ID', 'Item Price', | |
'Quantity', 'Amount Paid (£)'] | |
print(orders.shape) | |
orders.head(10) | |
#orders.groupby('Customer ID')['Order ID'].count()) | |
#orders.groupby('Customer ID')['Amount Paid (£)'].sum() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment