{"comment":{"url":"https://api.github.com/repos/xochitli/SaturdaysAI/comments/34974323","html_url":"https://github.com/xochitli/SaturdaysAI/commit/ab2c96300876ef2b13adbea65b05503732e5fb07#commitcomment-34974323","id":34974323,"node_id":"MDEzOkNvbW1pdENvbW1lbnQzNDk3NDMyMw==","user":{"login":"EduCasM","id":53205307,"node_id":"MDQ6VXNlcjUzMjA1MzA3","avatar_url":"https://avatars1.githubusercontent.com/u/53205307?v=4","gravatar_id":"","url":"https://api.github.com/users/EduCasM","html_url":"https://github.com/EduCasM","followers_url":"https://api.github.com/users/EduCasM/followers","following_url":"https://api.github.com/users/EduCasM/following{/other_user}","gists_url":"https://api.github.com/users/EduCasM/gists{/gist_id}","starred_url":"https://api.github.com/users/EduCasM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EduCasM/subscriptions","organizations_url":"https://api.github.com/users/EduCasM/orgs","repos_url":"https://api.github.com/users/EduCasM/repos","events_url":"https://api.github.com/users/EduCasM/events{/privacy}","received_events_url":"https://api.github.com/users/EduCasM/received_events","type":"User","site_admin":false},"position":369,"line":369,"path":"practicanike.ipynb","commit_id":"ab2c96300876ef2b13adbea65b05503732e5fb07","created_at":"2019-09-06T05:29:36Z","updated_at":"2019-09-06T05:29:36Z","author_association":"NONE","body":"Si observas tu 'table' final estás perdiendo las columnas 'codigo' y 'year'.\r\nAl aplicar el método 'pivot_table' las columnas agrupadas (['Codigo','Year'])  se convierten en el index del dataframe resultante. \r\nPara no perder estas columnas usa el método 'reset_index()' .\r\nhttps://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.reset_index.html\r\npresta atención al parámetro 'drop'. \r\n\r\ne.g. \r\ntable = df.pivot_table(index=['Codigo','Year'], columns='Month', values='Units', aggfunc=np.sum, fill_value=0).reset_index()"}}
{"actor":{"display_login":"EduCasM"}}