# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# +
import sys
import numpy as np
import matplotlib.pyplot as plt
MARKERS = ['+', 'o', "*", "p", "s", "x", "h", "d", "<", ">", 'H', 'D', 'd', 'P', 'X']

def _read_data(data_file):
    names = []
    rows = []
    with open(data_file) as lines:
        for line in lines:
            values = line.strip().split(',')
            names.append(values[0])
            rows.append(values[1:10000]) 
    return names, rows

def plot_harvestrate_page(data_file):
    names, rows = _read_data(data_file)
    global MARKERS
    print len(rows[3])
    plt.plot(rows[1], marker=MARKERS[0], markevery=500)
    plt.plot(rows[2], marker=MARKERS[1], markevery=500)
    plt.plot(rows[3], marker=MARKERS[2], markevery=500)
    plt.plot(rows[4], marker=MARKERS[3], markevery=500)
    plt.plot(rows[5], marker=MARKERS[4], markevery=500)
    print names
    plt.legend(names[1:6], loc=2, fontsize=11)
    plt.show()
    
def plot_harvestrate_site(data_file):
    names, rows = _read_data(data_file)
    global MARKERS
    plt.plot(rows[6], marker=MARKERS[0], markevery=500)
    plt.plot(rows[7], marker=MARKERS[1], markevery=500)
    plt.plot(rows[8], marker=MARKERS[2], markevery=500)
    plt.plot(rows[9], marker=MARKERS[3], markevery=500)
    plt.plot(rows[10], marker=MARKERS[4], markevery=500)
    print names
    plt.legend(names[6:], loc=2, fontsize=11)
    plt.show()

def main():
    data_file = 'ads.csv'
    plot_harvestrate_page(data_file)
    plot_harvestrate_site(data_file)

main()
# -





StarcoderdataJupyterScriptsDedupFiltered