On Tue, Sep 24, 2019 at 1:04 PM Bappa Bhalsing via BangPypers < bangpypers@python.org> wrote:
> Hello All, > I am trying to run following program using python and i am getting error > consistently. > Please to resolve. > input_file = '.\Desktop\height-weight.csv'import pandas as pd > from pandas import DataFrame as df > df = pd.read_csv(input_file)df.head() > o/p is OK > df('height') = df['Height(inches)'].map(lambda inches: round(inches * > 0.83322 , 2))df.head() > getting following errorFile "<ipython-input-9-2a96b594216d>", line 1 > df('height') = df['Height(inches)'].map(lambda inches: round(inches * > 0.83322 , 2)), > > ^ > SyntaxError: can't assign to function call > > Replace *df('height') = df['Height(inches)'].map(lambda inches: round(inches * 0.83322 , 2)) *with below. Should work for you. *df['height'] = df['Height(inches)'].map(lambda inches: round(inches * 0.83322 , 2))* *-*Shanki > Regards, > Bappa > > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers