Hello, I have a dataframe that contain some data.
Purchased Price Selling Price
100 200
100 99
200 150
100 150
50 60
70 50
80 100
25 15
30 40
50 25
I want to optimize this program so that it takes less time.
program code is:-
import pandas as pd
data_store = pd.read_excel("101010.xlsx")
if data_store.iloc[0]["Purchased Price"] > data_store.iloc[0]["Selling Price"]:
# Execute some program.
print(data_store.iloc[0], "\nTaking Loss")
else:
# Execute some program.
print(data_store.iloc[0], "\nTaking Profit")
if data_store.iloc[1]["Purchased Price"] > data_store.iloc[1]["Selling Price"]:
# Execute some program.
print(data_store.iloc[1], "\nTaking Loss")
else:
# Execute some program.
print(data_store.iloc[1], "\nTaking Profit")
if data_store.iloc[2]["Purchased Price"] > data_store.iloc[2]["Selling Price"]:
# Execute some program.
print(data_store.iloc[2], "\nTaking Loss")
else:
# Execute some program.
print(data_store.iloc[2], "\nTaking Profit")
Please can any body tell me that how can I optimize this programme so that it takes less time to execute.
Thank you in advance :) :) :)