Hi, can someone help me, i search to find code to access the value of column3 in a dataframe, when this value is <= 0, then write these to a textfile.
I have a dataframe with 4 columns and 1000 rows, all are integer except column with index 3, is float and is used for currency (example: 2022,01,123456,23.25), this value can be zero or negative and want these row writing to another txt file.
my code:
data2 = pd.to_csv(dataOUT, dataIN[column(3)], fmt=fFiles).
What’s wrong?
Is there a lambda function for this?
Thanks in advance for your helping brains.
This does not map to your use of the method. dataOUT should contain a file path, be a file-like structure or None.
dataIN[column(3)] should contain a separator, that seems really improbable if not impossible. Use the column= keyword to select columns. I could not find any example to select columns based on number and I have never done that. Maybe you have to name your columns, so you can select on label here.
There is no argument with key fmt, I don’t know what you think that will do.