You can use DataFrame.filter
this way:
import pandas as pd
df = pd.DataFrame(np.array([[2,4,4],[4,3,3],[5,9,1]]),columns=['d','t','didi'])
>>
d t didi
0 2 4 4
1 4 3 3
2 5 9 1
df.filter(regex=("d.*"))
>>
d didi
0 2 4
1 4 3
2 5 1
The idea is to select columns by regex
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…