3 回答

TA貢獻(xiàn)1816條經(jīng)驗(yàn) 獲得超4個(gè)贊
您只是想在 csv 中找到最小值或最小值嗎?你可以這樣做:
import pandas as pd
df = pd.read_csv(file_path)
# To get smallest value in each column
smallest_value_by_column = df.min(axis=0)
# To get smallest value in each row
smallest_value_by_column = df.min(axis=1)

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超3個(gè)贊
兩步。首先是為每一行找到最小值。然后在它周?chē)昼姟?/p>
import csv
with open('input_3.csv') as File:
reader = csv.reader(File, delimiter=';')
min_rows = []
for row in reader:
value = min(row)
min_rows.append(value)
print(min(min_rows))
添加回答
舉報(bào)