Beispiel #1
0
def disassemble(data):
    output = io()
    offset = 0
    while offset < len(data):
        s = disassemble_one(data, offset)
        if s:
            output.write(s + "\n")
        offset += 8
    return output.getvalue()
Beispiel #2
0
def get_data(query, sql_source):
    '''submits a query to queryCartoDB and returns a pandas dataframe
    Arguments: 
    query - string: a valid sql query string
    source - a valid sql api endpoint OPTIONAL (e.g. fb55 account)
    '''
    try:
        return pd.read_csv(io(queryCartoDB(query, source=sql_source)), sep = ',')
    except ValueError as v:
        print (str(v))
Beispiel #3
0
def _string2Dataframe(data):
    sb = io(data)
    dataFrame = pd.read_csv(sb, sep=' ', names=('d', 'amp')).sort('d')
    return dataFrame
Beispiel #4
0
def assemble(source):
    insts = parse(source)
    output = io()
    for inst in insts:
        output.write(assemble_one(inst))
    return output.getvalue()
Beispiel #5
0
def _string2Dataframe(data):
    sb = io(data)
    dataFrame = pd.read_csv(sb, sep=' ', names=('d', 'amp')).sort('d')
    return dataFrame