Googling this problem it only seems to come up when using a classifier, though I'm trying to normalise a column, and it seems to need a 2d array, but I'm not sure how I would make a 2d array out of my single column:
Error msg:
Please find a small sample of numbers (can change to whatever typing necessary, currently in float as the error message mentioned float but I'd rather it be int):
I would try to do something like:
wgt_l1 = normalize(data.wgt, norm='l1') wgt_l2= normalize(data.wgt, norm='l2')Considering my weighting ranges from over 400,000 to below 20,000 means I should probably normalise it, though I can't seem to get the method to run properly. Not as much the actual code, but can I ask why it is necessary to need a 2d array to normalise?
Error msg:
Please find a small sample of numbers (can change to whatever typing necessary, currently in float as the error message mentioned float but I'd rather it be int):
I would try to do something like:
data.wgt.reshape(-1,1)But then I get the error:
Error:AttributeError: 'Series' object has no attribute 'reshape'
data['wgt'] = MinMaxScaler().fit_transform(data['wgt'].values.reshape(-1,1))Got it with this, though I still don't understand why it must be 2d?