I have a csv file that contain product data. It has 3 column which are product_name, price and website.
Below is my code. I want to get the lowest price in python but I am not sure which part I did wrong.
import pandas as pd
data = pd.read_csv("product_list.csv")
df = pd.DataFrame(data, columns= ['price'])
df['price'] = pd.to_numeric(df['price'], errors='coerce')
prices = 99
temp = []
for i in df:
temp.append(df.price)
for i in temp:
if temp[i]<prices:
prices = temp[i]
print(prices)
The error state "TypeError: list indices must be integers or slices, not Series"