Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created January 30, 2018 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/d3164f08ea9ed076c8cc1fe7f98759b2 to your computer and use it in GitHub Desktop.
Save Fhernd/d3164f08ea9ed076c8cc1fe7f98759b2 to your computer and use it in GitHub Desktop.
Guardar datos de un DataFrame en una hoja de cálculo en Python.
import pandas as pd
import openpyxl
# Definición diccionario:
diccionario = {'pares': [0, 2, 4, 6], 'impares': [1, 3, 5, 7]}
# Creación DataFrame:
df_numeros = pd.DataFrame(diccionario)
# Guarda datos en XLSX:
df_numeros.to_excel('numeros.xlsx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment