<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_array(path, group=None):
 """ Load an Array from a .hdf, .txt or .npy file. The default data types will be double precision floating point. Parameters path : string source file path. Must end with either .npy or .txt. group: string Additional name for internal storage use. Ex. hdf storage uses this as the key value. Raises ------ ValueError If path does not end in .npy or .txt. """

    ext = _os.path.splitext(path)[1]
    if ext == '.npy':
        data = _numpy.load(path)    
    elif ext == '.txt':
        data = _numpy.loadtxt(path)
    elif ext == '.hdf':
        key = 'data' if group is None else group
        return Array(h5py.File(path)[key]) 
    else:
        raise ValueError('Path must end with .npy, .hdf, or .txt')
        
    if data.ndim == 1:
        return Array(data)
    elif data.ndim == 2:
        return Array(data[:,0] + 1j*data[:,1])
    else:
        raise ValueError('File has %s dimensions, cannot convert to Array, \
                          must be 1 (real) or 2 (complex)' % data.ndim)