Skip to content

Instantly share code, notes, and snippets.

@tbotalla
Last active September 23, 2018 23:17
Show Gist options
  • Save tbotalla/088ec2c8209f8c026cc693ce5437d335 to your computer and use it in GitHub Desktop.
Save tbotalla/088ec2c8209f8c026cc693ce5437d335 to your computer and use it in GitHub Desktop.
Gist de Referencia con lineas utiles de código al usar Pandas para analisis exploratorio de datos
# Convertir columna a string
total_rows['ColumnID'] = total_rows['ColumnID'].astype(str)
# Eliminar filas cuyo valor para la columna A son nan
df.dropna(subset=['A'])
# Distribucion de valores para una cierta columna
events['city'].value_counts()
# Chequear si una columna tiene algun valor null
visited_site_events['screen_resolution'].isnull().any()
# Agrupar por multiples columnas y aplicar operacion de agregacion sobre una de ellas
df.groupby(["person", "session_num"]).agg({"session_num":"count"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment