<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_data(filename):
 """Loads data from a file. Parameters filename : :obj:`str` The file to load the collection from. Returns ------- :obj:`numpy.ndarray` of float The data read from the file. Raises ------ ValueError If the file extension is not .npy or .npz. """

        file_root, file_ext = os.path.splitext(filename)
        data = None
        if file_ext == '.npy':
            data = np.load(filename)
        elif file_ext == '.npz':
            data = np.load(filename)['arr_0']
        else:
            raise ValueError('Extension %s not supported for point reads' %(file_ext))
        return data