def delete_zero_amount_exchanges(data, drop_types=None):
    """Drop all zero value exchanges from a list of datasets.

    ``drop_types`` is an optional list of strings, giving the type of exchanges to drop; default is to drop all types.

    Returns the modified data."""
    if drop_types:
        dont_delete = lambda x: x["type"] not in drop_types or x["amount"]
    else:
        dont_delete = lambda x: x["amount"]
    for ds in data:
        ds["exchanges"] = list(filter(dont_delete, ds["exchanges"]))
    return data