I am trying to divide a column in my data set by 100 so as to turn it into a percentage (i.e. 99% = .99.) However, when I divide by 100 it returns zero for all values in the column. I understand " / " returns the floor division when dividing two integers. However, I turned the column into a float, and also divided the column by 100.0 (float.) Also, a lot of the values in the column are '100.0' to begin with, so when I divide by 100, it should return '1' if it was doing floor division. The ' + .04 ' part of the if statement is to account for an error in the report. Is it a problem with my for loop? I attached the code below.
import pandas as pd
import numpy as np
data = pd.read_csv('Lakeshore Variance.csv')
Percent = data['Percent at Cutoff'].astype(float)
for i in Percent:
if i < 96:
Percent = (Percent/100.0) + .04
else:
Percent = (Percent/100.0)