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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!