import numpy as np
import sys


def genfromtxt_compatible(inp_path,inp_file,dtype,full_file_path=None):
    if full_file_path is None:
        full_file_path = inp_path + inp_file

    if sys.version[0] == '3':
        data_arr    = np.genfromtxt(full_file_path,dtype=dtype,encoding="latin")
    elif sys.version[0] == '2':
        if np.__version__ < '1.14.0':
            data_arr    = np.genfromtxt(full_file_path,dtype=dtype)
        else:
            data_arr    = np.genfromtxt(full_file_path,dtype=dtype,encoding="latin")
    return data_arr
