import csv
import itertools


def gen_csv(f):
    """peek at rows from a csv and start yielding when we get past the comments
    to a row that starts with an int"""
    def startswith_int(row):
        try:
            int(row[0][0])
            return True
        except (ValueError, IndexError):
            return False

    cr = csv.reader(f)
    return itertools.dropwhile(lambda x: not startswith_int(x), cr)