I have this array :
[
{u'createdAt': datetime.datetime(2018, 8, 1, 12, 3, 41), u'rawValue': -200.0, u'data_type': 's'},
{u'createdAt': datetime.datetime(2018, 8, 1, 11, 58), u'rawValue': -200.0, u'data_type': 's'},
{u'createdAt': datetime.datetime(2018, 8, 1, 11, 56, 51), u'rawValue': -200.0, u'data_type': 'm'}
]
I want to get only one sub array that correspond on 2 conditions :
1 : createdAt is bigger
2 : data_type = s
Is possible to do this thing by using some libraries ?
I trying like this :
dataToReturn = []
for data in datas:
if date_type in data['data_type']:
dataToReturn.append(data['data_type'])
return dataToReturn
But seems is not the better idea.
Expected output :
['createdAt' : datetime.datetime(2018, 8, 1, 12, 3, 41), 'rawValue' : -200.0]