Pandas (Python) Data processing: Normalization of only one column of dataframe data

Source: Internet
Author: User

The processing of the data is pandas, but it has not been learned and does not know whether there is a method call that is directly normalized to a column. Himself dealing things down. The feeling is still more troublesome.

After reading to the array using pandas, I want to have the ' monthlyincome ' column normalized, and the chestnuts on the web are normalized to the entire dataframe, because some of my data are categories and cannot be used:

  

ImportPandas as PDImportNumPy as NP#Loading Data#CVSDF= Pd.read_csv ("Train1.csv")#normalizeds = (df['Monthlyincome']-df['Monthlyincome'].min ())/(df['Monthlyincome'].max ()-df['Monthlyincome'].min ())#safely deleted if with Del is permanently deletedDF2= Df.drop (['Monthlyincome'],axis=1)#Insert the normalized column into the array, and at the very beginning 14 I inserted him into section 15lie.Df2.insert (14,'Monthlyincome', s)
Print(Df2.columns[13:15])

Pandas (Python) Data processing: Normalization of only one column of dataframe data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.