Skip to content

Instantly share code, notes, and snippets.

@gustavoschmoeller
Last active January 8, 2021 15:03
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 gustavoschmoeller/556f3ebd5547d2db71c5b6462e01b0c7 to your computer and use it in GitHub Desktop.
Save gustavoschmoeller/556f3ebd5547d2db71c5b6462e01b0c7 to your computer and use it in GitHub Desktop.
# Trocando a colula final de semana de valores inteiros para strings
semana = {0:'Dia de semana', 1:'Final de semana'}
df['Final de Semana'] = df['Final de Semana'].apply(lambda x:semana[x])
# Trocando a colula feriado de valores inteiros para strings
feriado = {0:'Não é feriado', 1:'Feriado'}
df['Feriado'] = df['Feriado'].apply(lambda y:feriado[y])
# Trocando a colula dia util de valores inteiros para strings
dia_util = {0:'Não é dia util', 1:'Dia util'}
df['Dia util'] = df['Dia util'].apply(lambda z:dia_util[z])
df.head(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment