load_data.py
def series2mat4(hp):
    """
    Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array

    :param hp: Pandas Series containing an affine matrix describing position and orientation
    :return:
    """
    return np.array([[hp.loc['Value.M11'], hp.loc['Value.M21'], hp.loc['Value.M31'], hp.loc['Value.M41']],
                     [hp.loc['Value.M12'], hp.loc['Value.M22'], hp.loc['Value.M32'], hp.loc['Value.M42']],
                     [hp.loc['Value.M13'], hp.loc['Value.M23'], hp.loc['Value.M33'], hp.loc['Value.M43']],
                     [hp.loc['Value.M14'], hp.loc['Value.M24'], hp.loc['Value.M34'], hp.loc['Value.M44']]])

    Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array

    :param hp: Pandas Series containing an affine matrix describing position and orientation
    :return:
    
Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array
Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array
def series2mat4(hp):
    return np.array([[hp.loc['Value.M11'], hp.loc['Value.M21'], hp.loc['Value.M31'], hp.loc['Value.M41']],
                     [hp.loc['Value.M12'], hp.loc['Value.M22'], hp.loc['Value.M32'], hp.loc['Value.M42']],
                     [hp.loc['Value.M13'], hp.loc['Value.M23'], hp.loc['Value.M33'], hp.loc['Value.M43']],
                     [hp.loc['Value.M14'], hp.loc['Value.M24'], hp.loc['Value.M34'], hp.loc['Value.M44']]])
def series2mat4 ( hp ) : return np . array ( [ [ hp . loc [ 'Value.M11' ] , hp . loc [ 'Value.M21' ] , hp . loc [ 'Value.M31' ] , hp . loc [ 'Value.M41' ] ] , [ hp . loc [ 'Value.M12' ] , hp . loc [ 'Value.M22' ] , hp . loc [ 'Value.M32' ] , hp . loc [ 'Value.M42' ] ] , [ hp . loc [ 'Value.M13' ] , hp . loc [ 'Value.M23' ] , hp . loc [ 'Value.M33' ] , hp . loc [ 'Value.M43' ] ] , [ hp . loc [ 'Value.M14' ] , hp . loc [ 'Value.M24' ] , hp . loc [ 'Value.M34' ] , hp . loc [ 'Value.M44' ] ] ] )
Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array
Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array
"""
    Reads the head position as coded by Bonsai from a DataFrame and converts it to a 2D NumPy array

    :param hp: Pandas Series containing an affine matrix describing position and orientation
    :return:
    """
None
hp
Pandas Series containing an affine matrix describing position and orientation
Pandas Series containing an affine matrix describing position and orientation