Python 从时间戳列表中获取小时和分钟

Python 从时间戳列表中获取小时和分钟,python,pandas,timestamp,hour,minute,Python,Pandas,Timestamp,Hour,Minute,我有以下清单: Index([2020-11-14 07:00:00, 2020-11-14 07:03:00, 2020-11-14 07:06:00, 2020-11-14 07:09:00, 2020-11-14 07:12:00, 2020-11-14 07:15:00, 2020-11-14 07:18:00, 2020-11-14 07:21:00, 2020-11-14 07:24:00, 2020-11-14 07:27:00,

我有以下清单:

Index([2020-11-14 07:00:00, 2020-11-14 07:03:00, 2020-11-14 07:06:00,
       2020-11-14 07:09:00, 2020-11-14 07:12:00, 2020-11-14 07:15:00,
       2020-11-14 07:18:00, 2020-11-14 07:21:00, 2020-11-14 07:24:00,
       2020-11-14 07:27:00,
       ...
       2020-11-14 16:33:00, 2020-11-14 16:36:00, 2020-11-14 16:39:00,
       2020-11-14 16:42:00, 2020-11-14 16:45:00, 2020-11-14 16:48:00,
       2020-11-14 16:51:00, 2020-11-14 16:54:00, 2020-11-14 16:57:00,
       2020-11-14 17:00:00],
      dtype='object', length=201)
列表中项目的类型:

type(time_lst[0])
>>>pandas._libs.tslibs.timestamps.Timestamp
我想浏览一下我的lsit中的项目,只提取小时和分钟,以获得如下内容:

[07:00,07:03,07:06,07:09....]
time_lst=tmp.columns
for i in time_lst:
    h=i.hour
    m=i.min
    item=str(h)+':'+str(m)
    
    print(item)
到目前为止,我发现只有关于如何分别获取小时或分钟的帖子。我设法只提取了小时,但我没有资金如何安排时间和分钟

#here I get all the timestamp items inside my lsit from pandas dataframe
time_lst=tmp.columns

#get the hour
for i in time_lst:
    x=i.hour
    print(x)
我做了一些类似的事情:

[07:00,07:03,07:06,07:09....]
time_lst=tmp.columns
for i in time_lst:
    h=i.hour
    m=i.min
    item=str(h)+':'+str(m)
    
    print(item)
但这会打印奇怪的值(7:1677-09-21 00:12:43.145225),我相信有更高效、更智能的方法来提取小时和分钟,然后将其转换为字符串


我的最终目标创建一个新列表,该列表仅包含我的时间戳列表中的小时和分钟

如果需要处理
DatetimeIndex
使用:

如果需要处理列表或
DatetimeIndex
使用列表理解:


您可以使用strftime:

pd.to_datetime(pd.Series("your list")).dt.strftime("%H:%M")