セクション 3. 章 12
single
max() and min()
メニューを表示するにはスワイプしてください
pandas provides the max() method, which returns the highest value from a dataset.
df = pd.read_csv(file.csv)
max_value = df.max()
To identify the highest value of a specific column, you can use this approach:
df = pd.read_csv(file.csv)
max_values = df['column_name'].max()
Similarly, pandas offers the min() method that fetches the smallest value from a dataset.
df = pd.read_csv(file.csv)
min_value = df.min()
To determine the smallest value for a particular column, the same method is used:
df = pd.read_csv(file.csv)
min_values = df['column_name'].min()
タスク
スワイプしてコーディングを開始
You are given a DataFrame named audi_cars.
- Find the highest price in the
'price'column and store the result in thehighest_pricevariable. - Find the lowest price in the
'price'column and store the result in thelowest_pricevariable.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 3. 章 12
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください