def prepareDFgeneral(dfAllCancerData):

    """
    Given that the entire PSP cancer data is passed as a dataframe, it
    i) separates the genes (features) from the target variables, 
    that is: CancerStatus, Project, TumorStage, Race, and Gender
    ii) asks the user to chose one of them as the class variable
    iii)removes the rest and adds the chosen variable as the first column, followed by
    the entire genes (features) and returns as a dataframe ready to work on.    
    """      
    
    # Determine the number of genes (features) in the dataframe
    # Note that the dataframe is arranged such that "CancerStatus" is the first
    # class variable, so all columns before "CancerStatus" are genes.
    numFeatures = dfAllCancerData.columns.get_loc('CancerStatus')
    
    features = dfAllCancerData.iloc[:, 0:numFeatures]
#    f_names = list(features.columns)
    
    targets = dfAllCancerData.iloc[:, numFeatures:len(dfAllCancerData.columns)]
    t_names = list(targets.columns)
    print("\n*********************************************")
    while True:
        ClassVar = input("Choose a class variable (" + ' '.join(t_names) + "): ")
        if ClassVar in t_names:
            break
        else:
            print("Please splell correctly!")
            
    print("\n*********************************************")
    target = targets[ClassVar]
    df = features
    df[ClassVar] = target
    
    # Class variable is the last column, bringing it to the first place.
    cols = df.columns.tolist()
    cols = cols[-1:] + cols[:-1]
    df = df[cols]

    return df