import pandas as pd
from datetime import datetime
# Input
ref_time = datetime(2019,7,12,16,41,20)
data = [[6160, 'Upper', '12-7-2019 12:37:51.123572'],
[6162, 'Upper', '12-7-2019 12:39:22.355725'],
[6175, 'Upper', '12-7-2019 13:21:15.224157'],
[6180, 'Upper', '13-7-2019 06:04:29.157111'],
[6263, 'Upper', '13-7-2019 07:37:51.123572']]
# Convert 2D list to DataFrame object
df = pd.DataFrame(data)
# Convert timestamp strings in column at index 2 to datetime objects
df.iloc[:, 2] = pd.to_datetime(df.iloc[:, 2], format='%d-%m-%Y %H:%M:%S.%f')
# Return row with minimum absolute time difference to reference time
print(df.loc[[(abs(df.iloc[:, 2]-ref_time)).idxmin()]])