Question: What is wrong with my Python code? I want it to search 2 columns BIT_return and TSX_return where it is
What is wrong with my Python code?
I want it to search 2 columns "BIT_return" and "TSX_return" where it is <=-0.02, in the excel data file called "excel_data". I need to use loc function because I want to compute the percentage of change.
CODE:
CaseA = excel_data[ 'BIT_return', 'TSX_return' ].loc [ ( excel_data [ ' BIT_return ',' TSX_return' ] <=-0.02 ) ] excel_data['Return_A']=excel_data['CaseA'].pct_change()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
