sda.misc.basics =============== .. py:module:: sda.misc.basics .. autoapi-nested-parse:: Original Spy package functions, moved into SDA to avoid Spy dependency. Functions --------- .. autoapisummary:: sda.misc.basics.autoturn sda.misc.basics.key_max_val Module Contents --------------- .. py:function:: autoturn(data, key = -1) Transpose an array if necessary. :param data: Array to transpose. :type data: :py:class:`np.ndarray` :param key: Key value: - 0: don't transpose. - 1: transpose. - -1: auto: make sure the vectors are along the longest dimension, by default -1. :type key: :py:class:`int`, *optional* :returns: Transposed array. :rtype: :py:class:`np.ndarray` :raises ValueError: If `key` is not 0, 1 or -1. .. py:function:: key_max_val(d) Return the dictionary key with max value. :param d: Dictionary to check. :type d: :py:class:`dict` :returns: Key with max value. :rtype: :py:class:`Any`