Skip to content

Instantly share code, notes, and snippets.

@Theasker
Last active October 4, 2022 09:37
Show Gist options
  • Select an option

  • Save Theasker/88e407b35e1e4914f184e231ba320213 to your computer and use it in GitHub Desktop.

Select an option

Save Theasker/88e407b35e1e4914f184e231ba320213 to your computer and use it in GitHub Desktop.
Modificación de formato de las fechas en una columna de un archivo excel en python
import pandas as pd
# Read the file and specify which column is the date
rows = pd.read_excel("excel.xlsx")
print(rows["Columna1"])
# Output with dates converted to YYYY-MM-DD
fecha = pd.to_datetime(rows["Columna1"]).dt.strftime("%d-%m-%y")
rows["Columna1"] = fecha
rows.to_excel("excel_dd_mm_yy.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment