def export_avg_losses_ebrisk(ekey, dstore):
    """
    :param ekey: export key, i.e. a pair (datastore key, fmt)
    :param dstore: datastore object
    """
    name = ekey[0]
    oq = dstore['oqparam']
    dt = oq.loss_dt()
    value = dstore[name].value  # shape (A, L)
    writer = writers.CsvWriter(fmt=writers.FIVEDIGITS)
    assets = get_assets(dstore)
    dest = dstore.build_fname(name, 'mean', 'csv')
    array = numpy.zeros(len(value), dt)
    for l, lt in enumerate(dt.names):
        array[lt] = value[:, l]
    writer.save(compose_arrays(assets, array), dest)
    return writer.getsaved()
def export_avg_losses_ebrisk ( ekey , dstore ) : name = ekey [ 0 ] oq = dstore [ 'oqparam' ] dt = oq . loss_dt ( ) value = dstore [ name ] . value writer = writers . CsvWriter ( fmt = writers . FIVEDIGITS ) assets = get_assets ( dstore ) dest = dstore . build_fname ( name , 'mean' , 'csv' ) array = numpy . zeros ( len ( value ) , dt ) for l , lt in enumerate ( dt . names ) : array [ lt ] = value [ : , l ] writer . save ( compose_arrays ( assets , array ) , dest ) return writer . getsaved ( )
:param ekey: export key, i.e. a pair (datastore key, fmt)
    :param dstore: datastore object