New Code Cell #6

def FChange (vector,string):
    vec = vector.loc[:,string]
    idx1 = np.where(vec==1)
    idx2 = np.where(vec==2)
    idx4 = np.where(vec==4)
    idx5 = np.where(vec==5)

    vec2 = np.put(vector.loc[:,string],idx1,5)
    vec2 = np.put(vector.loc[:,string],idx2,4)
    vec2 = np.put(vector.loc[:,string],idx4,2)
    vec2 = np.put(vector.loc[:,string],idx5,1)
    return vector

Comments

Popular posts from this blog

6/14/17 Notes

6/06/17 Notes (formatting code and searching for a specific person)

May 22, 2017 -- SienaSemanticsSurvey -- Code Breakdown -- Cell #8