Exemplo n.º 1
0
def _plot_vals_from_list(to_plot, title, ylabel, xlabel='Date'):
    with open(to_plot, mode='r') as infile:
        reader = csv.reader(infile)
        data = {rows[0]: rows[1] for rows in reader}

    plot.plot_frequency_map(data,
                            title=title,
                            xlabel=xlabel,
                            ylabel=ylabel,
                            show=True)
Exemplo n.º 2
0
def _plot_vals_from_time_slices(prefix, title, ylable):
  files = [ f for f in listdir('../csv_data/') if isfile(join('../csv_data/',f)) ]
  to_graph = {}
  for filename in files:
    if filename.startswith(prefix):
      # if filename[0:1].isdigit():
      start, end = _extract_start_and_end(filename[len(prefix) + 1:])
      # start, end = _extract_start_and_end(filename)
      vals = _get_vals_from_csv(filename)
      calc_gini(vals)
      to_graph[start] = calc_gini(vals)
  plot.plot_frequency_map(to_graph, title=title, ylabel=ylabel, xlabel='Date', show=True)
Exemplo n.º 3
0
def _plot_vals_from_time_slices(prefix, title, ylable):
    files = [
        f for f in listdir('../csv_data/') if isfile(join('../csv_data/', f))
    ]
    to_graph = {}
    for filename in files:
        if filename.startswith(prefix):
            # if filename[0:1].isdigit():
            start, end = _extract_start_and_end(filename[len(prefix) + 1:])
            # start, end = _extract_start_and_end(filename)
            vals = _get_vals_from_csv(filename)
            calc_gini(vals)
            to_graph[start] = calc_gini(vals)
    plot.plot_frequency_map(to_graph,
                            title=title,
                            ylabel=ylabel,
                            xlabel='Date',
                            show=True)
Exemplo n.º 4
0
def _plot_vals_from_list(to_plot, title, ylabel, xlabel='Date'):
  with open(to_plot, mode='r') as infile:
    reader = csv.reader(infile)
    data = {rows[0]:rows[1] for rows in reader}

  plot.plot_frequency_map(data, title=title, xlabel=xlabel, ylabel=ylabel, show=True)