i have a csv file that contains following columns: Open High Low Close modelprediction…
- User
i have a csv file that contains following columns:
Open High Low Close model_prediction
give me the proper python code to:
start from the first row if model_prediction of a row was 1, for the next 2 rows calculate the percentage of changes of their "High" value compared to the "Close" value of current row(row with model_prediction of 1), and put them in new column named "High change" also for the next 2 rows calculate the percentage of changes of their "Low" value compared to the "Close" value of current row(row with model_prediction of 1), and put them in new column named "Ligh change"
- Assistant
To solve this, you can use Python's Pandas library, which is excellent for handling CSV files and performing data manipulation. First, you need to install pandas if you haven't yet. You can install it using pip: