I can't tell if your datetime column is an index or a column without a name? If its a column without a name:
df = df.rename(columns={"": "DateTime"})
df["Time"] = pd.to_datetime(df["DateTime"]).dt.time
df_dict = {x: pd.DataFrame for x in df["Time"].unique()}
for key in df_dict.keys():
df_dict[key] = df.query("Time.eq(@key)").reset_index(drop=True)
print(f"{df_dict[key]}\n")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.