Pandas (python) data processing: only the DataFrame data of a certain column is normalized.
Pandas is used to process data, but it has never been learned. I do not know whether a method call is directly normalized for a column. I figured it out myself. It seems quite troublesome.
After reading the Array Using Pandas, you want to normalize the 'monthlyincome 'column. All the online chestnuts are normalized for the entire dataframe, because some of my data columns are of a category and cannot be used:
Import pandas as pdimport numpy as np # load data # cvsdf = pd. read_csv ("train1.csv") # normalized s = (df ['monthlyincome ']-df ['monthlyincome']. min ()/(df ['monthlyincome ']. max ()-df ['monthlyincome ']. min () # Delete safely. If del is used to permanently delete df2 = df. drop (['monthlyincome '], axis = 1) # Insert the normalized column to the array. In the first 14, I inserted it to 15liedf2. insert (14, 'monthlyincome ', s)
Print (df2.columns [13: 15])