tmp saves the csv information, as shown in the following figure
and then sorts it by the size of F1:
score = tmp ["f1"] .order ()
score.head ()
len (score)
then divide the whole data 5 equally:
df = {}
close = tmp ["close"]
port1 = list (score.index) [: len (score) / / 5]
port2 = list (score.index) [len (score) / / 5: 2*len (score) / / 5]
port3 = list (score.index) [2 len (score) / 5:-2 len (score) / / 5]
port4 = list (score.index) [- 2*len (score) / / 5:-len (score) / 5]
port5 = list (score.index) [- len (score) / / 5:]
you want to get the close value of stock according to the difference of port.
def caculate_port_daily_return (port,start,end,close):
for stock in port
how do I get it? Please advise ~ Thank you ~