Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- logs = pd.read_csv('/datasets/yandex_metrika_logs.csv')
- logs_with_duration = logs[logs['ym:s:visitDuration'] > 0]
- ad_visits = logs_with_duration[logs_with_duration['ym:s:lastTrafficSource'] == 'ad']
- organic_visits = logs_with_duration[logs_with_duration['ym:s:lastTrafficSource'] == 'organic']
- print(ad_visits.head(10))
- print(organic_visits.head(10))
Advertisement
Add Comment
Please, Sign In to add comment