Fault to access column in dataframe

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.

The pandas documentation shows the following format for to_csv:
DataFrame.to_csv( *path_or_buf=None* , *sep=','* , *na_rep=''* , *float_format=None* , *columns=None* , *header=True* , *index=True* , *index_label=None* , *mode='w'* , *encoding=None* , *compression='infer'* , *quoting=None* , *quotechar='"'* , *line_terminator=None* , *chunksize=None* , *date_format=None* , *doublequote=True* , *escapechar=None* , *decimal='.'* , *errors='strict'* , *storage_options=None* )

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.

I found the solution to use the option dataframe(mask)

def mask():
fFile = ‘%i’,’%i’,’%i’,’%1.2f’
dataOUT = Path(…)
df = pd.DataFrame(dataIN, columns=[‘Jaar’,‘Maand’,‘BadgeNr’,‘Bedrag’])
mask = df[‘Bedrag’].values <= 0
n = df[mask]
np.savetxt(dataOUT, n, delimiter=’;’, fmt=fFile, header=“Foutieve Input”)

4 2020 7 47015 29.70
… … … … …
1087 2020 7 30536 41.65
1088 2020 7 8453 19.40
1089 2020 7 3901 11.85
1090 2020 7 36117 6.95
1091 2020 7 46814 2.80

[1092 rows x 4 columns] found

Result after reading file of 1092 rows

 Jaar  Maand  BadgeNr  Bedrag

134 2020 7 38245 0.0