有什么方法可以使用Python Pandas合并基于子列的父列

问题描述 投票:0回答:1

我有3列日期和班次,如下所示

Date    Shift   Subject
26th    Shift 1 English
26th    Shift 1 Maths
26th    Shift 1 Hindi
26th    Shift 2 Anatomy
26th    Shift 2 Physiology
26th    Shift 3 Earth Science
27th    Shift 1 VHDL
27th    Shift 1 Verilog
27th    Shift 1 Logic Design
27th    Shift 2 Power Electronics
27th    Shift 3 VBA
27th    Shift 4 Sociology
28th    Shift 1 Law1
28th    Shift 2 Law2

请注意,以上班次列中的日期与日期有关,主题列中的日期和日期与日期有关。我需要一个VBA代码,以便在下一张表中的图像输出下方显示此输出。

enter image description here

pandas
1个回答
0
投票
是,您可以尝试使用此代码:
© www.soinside.com 2019 - 2024. All rights reserved.