Jul-26-2019, 08:34 AM
(This post was last modified: Jul-26-2019, 08:35 AM by silkpantsman.)
Hi All,
First off I am very fresh to python and coding so apologies in advance.
I am trying to read values into a df.loc so that I can use an excel file to access the rows I want rather than manually typing them in each time. Currently, I have a basic line of code to change certain cells in a dataframe to another value.
I repeat this a bunch of times and currently, manually type in the cells in 'x'. Would it be possible to import values into x, y, z etc from another excel file?
First off I am very fresh to python and coding so apologies in advance.
I am trying to read values into a df.loc so that I can use an excel file to access the rows I want rather than manually typing them in each time. Currently, I have a basic line of code to change certain cells in a dataframe to another value.
df.loc[df.col1 == 'x', 'col2'] = 0 df.loc[df.col1 == 'y', 'col2'] = 0
I repeat this a bunch of times and currently, manually type in the cells in 'x'. Would it be possible to import values into x, y, z etc from another excel file?