current position:Home>Some questions about CSV file operation

Some questions about CSV file operation

2022-06-24 09:16:22CSDN Q & A

use python Yes csv operation , The table in the file has no header , I want to put the value in the third column as 1 Extract the rows of , But there are also... In the following columns 1. The first line of code is used , The improvement is not quite right , Later it was changed to the second line , Is the second row the third column for all rows

f = df.loc[df['1'] == 1]f = df.loc[df.iloc[:,2]== 1]

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/175/202206171648025380.html

Random recommended