{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/23104","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23104/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23104/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23104/events","html_url":"https://github.com/pandas-dev/pandas/issues/23104","id":369525546,"node_id":"MDU6SXNzdWUzNjk1MjU1NDY=","number":23104,"title":"Reindex broken","user":{"login":"boldt","id":750793,"node_id":"MDQ6VXNlcjc1MDc5Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/750793?v=4","gravatar_id":"","url":"https://api.github.com/users/boldt","html_url":"https://github.com/boldt","followers_url":"https://api.github.com/users/boldt/followers","following_url":"https://api.github.com/users/boldt/following{/other_user}","gists_url":"https://api.github.com/users/boldt/gists{/gist_id}","starred_url":"https://api.github.com/users/boldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boldt/subscriptions","organizations_url":"https://api.github.com/users/boldt/orgs","repos_url":"https://api.github.com/users/boldt/repos","events_url":"https://api.github.com/users/boldt/events{/privacy}","received_events_url":"https://api.github.com/users/boldt/received_events","type":"User","site_admin":false},"labels":[{"id":307649777,"node_id":"MDU6TGFiZWwzMDc2NDk3Nzc=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info","name":"Needs Info","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-10-12T12:13:30Z","updated_at":"2018-10-12T16:09:53Z","closed_at":null,"author_association":"NONE","body":"# MWE\r\n\r\n```python\r\nfrom __future__ import print_function\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\nprint(\"Panda version:\", pd.__version__)\r\nprint(\"+++++++++++++++++++++++++++++++++++\")\r\n\r\n####################################################\r\n# Config\r\n####################################################\r\n\r\npd.options.display.max_rows = 10\r\npd.options.display.float_format = '{:.1f}'.format\r\n\r\n####################################################\r\n# Read data\r\n####################################################\r\n\r\nfile = \"/tmp/california_housing_train.csv\"\r\nif(np.DataSource().exists(file)):\r\n\tdataset = file\r\nelse:\r\n\tdataset = \"https://download.mlcc.google.com/mledu-datasets/california_housing_train.csv\"\r\n\r\nsep=\",\"\r\ncalifornia_housing_dataframe = pd.read_csv(dataset, sep)\r\n\r\n####################################################\r\n# Reorder\r\n####################################################\r\n\r\nnewOrder = np.random.permutation(california_housing_dataframe.index)\r\ncalifornia_housing_dataframe_reordered = california_housing_dataframe.reindex(newOrder)\r\n\r\n####################################################\r\n# Merge and show diff of the heads\r\n####################################################\r\n\r\n# Let's take the heads of both datasetstand compare them\r\n# They should be different in (mostly) all elements \r\n\r\nhead1 = california_housing_dataframe.head(10)\r\nhead2 = california_housing_dataframe_reordered.head(10)\r\n\r\n# @see https://stackoverflow.com/a/36893675/605890\r\nmerged = head1.merge(head2, indicator=True, how='outer')\r\nprint(merged)\r\n```\r\n\r\n# Run on colab\r\n\r\nI created a colab for the MWE, which is based on pandas 0.22.0:\r\n\r\nhttps://colab.research.google.com/drive/19uDE_H4AtpLaEL6INrRrDMXkdANsNr69#scrollTo=CzxuGppV26Rt\r\n\r\nIf you run it, you see at the output (if non is doubled randomly):\r\n\r\n* 10x `left_only`\r\n* 10x `right_only`\r\n\r\n# Run with docker containers\r\n\r\nNow, run the same MWE (located under `/tmp/tf/Bug.py`) in a two different docker containers, which *uses* pandas 0.23.4,:\r\n\r\nBoth return:\r\n\r\n* 10x `both`\r\n\r\nThis means, both heads are the same, which means that `reindex` does not have any effect.\r\n\r\n## Python docker container (python 3.6.6)\r\n\r\n```\r\ndocker run --rm -it -v /tmp/tf/:/tmp/ python:3.6.6 /bin/bash -c \"pip install pandas && python /tmp/Bug.py\"\r\n```\r\n## tensorflow docker container (tensorsflow 1.11.0)\r\n\r\n```bash\r\ndocker run --rm -it -v /tmp/tf/:/tmp/ tensorflow/tensorflow:1.11.0-py3 python /tmp/Bug.py \r\n```\r\n\r\n# TLDR\r\n\r\nThe following code does not have any effect in pandas 0.23.4:\r\n\r\n```\r\ncalifornia_housing_dataframe_reordered = california_housing_dataframe.reindex(newOrder)\r\n```"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/429378289","html_url":"https://github.com/pandas-dev/pandas/issues/23104#issuecomment-429378289","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23104","id":429378289,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTM3ODI4OQ==","user":{"login":"boldt","id":750793,"node_id":"MDQ6VXNlcjc1MDc5Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/750793?v=4","gravatar_id":"","url":"https://api.github.com/users/boldt","html_url":"https://github.com/boldt","followers_url":"https://api.github.com/users/boldt/followers","following_url":"https://api.github.com/users/boldt/following{/other_user}","gists_url":"https://api.github.com/users/boldt/gists{/gist_id}","starred_url":"https://api.github.com/users/boldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boldt/subscriptions","organizations_url":"https://api.github.com/users/boldt/orgs","repos_url":"https://api.github.com/users/boldt/repos","events_url":"https://api.github.com/users/boldt/events{/privacy}","received_events_url":"https://api.github.com/users/boldt/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T16:09:53Z","updated_at":"2018-10-12T16:09:53Z","author_association":"NONE","body":"I missed `pd.show_versions()`. I'll do...."}}
{"actor":{"display_login":"boldt"}}