import datetime
import numpy as np

# sorts the second list according to the first list ascending based on indices

#INPUT
mydates = ['20140103','20141003','20150908','20140607']
mylist =['this','very','good','looks']

#FUNCTION
def sortdates(mydates,mylist):
       
        indices = np.argsort(mydates)
        #dates.sort()
        sortedlist= []
        for myindex in indices: 
            print(myindex)

            sortedarray.append(mylist[myindex])
        print(sortedlist)


#RUN
sortdates(mydates,mylist)

e8ed2b0f5b3bd89dc7c9ec7ee2526b92acaf2cfa
<mask token>


def sortdates(mydates, mylist):
    indices = np.argsort(mydates)
    sortedlist = []
    for myindex in indices:
        print(myindex)
        sortedarray.append(mylist[myindex])
    print(sortedlist)


<mask token>

<mask token>


def sortdates(mydates, mylist):
    indices = np.argsort(mydates)
    sortedlist = []
    for myindex in indices:
        print(myindex)
        sortedarray.append(mylist[myindex])
    print(sortedlist)


sortdates(mydates, mylist)

<mask token>
mydates = ['20140103', '20141003', '20150908', '20140607']
mylist = ['this', 'very', 'good', 'looks']


def sortdates(mydates, mylist):
    indices = np.argsort(mydates)
    sortedlist = []
    for myindex in indices:
        print(myindex)
        sortedarray.append(mylist[myindex])
    print(sortedlist)


sortdates(mydates, mylist)

import datetime
import numpy as np
mydates = ['20140103', '20141003', '20150908', '20140607']
mylist = ['this', 'very', 'good', 'looks']


def sortdates(mydates, mylist):
    indices = np.argsort(mydates)
    sortedlist = []
    for myindex in indices:
        print(myindex)
        sortedarray.append(mylist[myindex])
    print(sortedlist)


sortdates(mydates, mylist)

import datetime
import numpy as np

# sorts the second list according to the first list ascending based on indices

#INPUT
mydates = ['20140103','20141003','20150908','20140607']
mylist =['this','very','good','looks']

#FUNCTION
def sortdates(mydates,mylist):
       
        indices = np.argsort(mydates)
        #dates.sort()
        sortedlist= []
        for myindex in indices: 
            print(myindex)

            sortedarray.append(mylist[myindex])
        print(sortedlist)


#RUN
sortdates(mydates,mylist)
