MCPcopy Create free account
hub / github.com/ccxt/ccxt / sort_by

Method sort_by

python/ccxt/base/exchange.py:1147–1148  ·  view source on GitHub ↗
(array, key, descending=False, default=0)

Source from the content-addressed store, hash-verified

1145
1146 @staticmethod
1147 def sort_by(array, key, descending=False, default=0):
1148 return sorted(array, key=lambda k: k[key] if k[key] is not None else default, reverse=descending)
1149
1150 @staticmethod
1151 def sort_by_2(array, key1, key2, descending=False):

Callers 15

fetch_l2_order_bookMethod · 0.95
test_sort_by_1Function · 0.95
test_aggregateFunction · 0.95
set_marketsMethod · 0.95
parse_ordersMethod · 0.95
fetch_l2_order_bookMethod · 0.95
parse_order_bookMethod · 0.95
parse_ohlcvsMethod · 0.95
parse_transactionsMethod · 0.95
parse_transfersMethod · 0.95
parse_ledgerMethod · 0.95

Calls

no outgoing calls

Tested by 2

test_sort_by_1Function · 0.76
test_aggregateFunction · 0.76