-1

In python I have a column name on Pandas:

Example

country/Region 1/22/19  1/23/19  1/24/19  1/25/19  1/26/19

how can I change date to weekday

country/Region Tue   Wed       Thu     Fri       Sat

*It have a lot of column than Example

thexsecret
  • 13
  • 2

1 Answers1

0

Assuming all your columns are dates, use something like:

df.columns = [pd.to_datetime(col).day_name() for col in df.columns]
ilyankou
  • 1,309
  • 8
  • 13