new file: aggregates/a-b project/code.py new file: aggregates/codecademy_code/script.py new file: aggregates/codecademy_code/test1.py modified: aggregates/orders.csv new file: aggregates/python-aggregatesI.py new file: aggregates/python-aggregatesII.py new file: aggregates/python-aggregatesIII.py new file: aggregates/python-aggregatesIV.py new file: aggregates/python-aggregatesV.py Added aggregate files
18 lines
487 B
Python
18 lines
487 B
Python
import pandas as pd
|
|
|
|
orders = pd.read_csv('orders.csv')
|
|
|
|
print(orders.head(10))
|
|
|
|
print(user_visits.head(10))
|
|
click_source = user_visits.groupby('utm_source').id.count().reset_index()
|
|
print(click_source)
|
|
|
|
click_source_by_month = user_visits.groupby(['utm_source', 'month']).id.count().reset_index()
|
|
|
|
print(click_source_by_month)
|
|
|
|
click_source_by_month_pivot = click_source_by_month.pivot(columns='month', index='utm_source', values='id').reset_index()
|
|
|
|
print(click_source_by_month_pivot)
|