Created
August 31, 2014 03:55
-
-
Save kf0jvt/dd0941f3ddbbc0f724a1 to your computer and use it in GitHub Desktop.
When I sort a data frame and plot it the values are properly sorted but the labels are not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:70ec5770cd4e35c7a408514277aa748a06612e2b2f4441a5efd73e02746d1a6b" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "heading", | |
"level": 1, | |
"metadata": {}, | |
"source": [ | |
"Weird Sorting thing" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"So it appears that when I sort a data frame and then plot it the values column is properly sorted, but the labels are not sorted. Unless you look at the data frame itself. Then everything looks right. Here is some example code." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"import pandas as pd\n", | |
"from pandas import DataFrame as df\n", | |
"import matplotlib.pyplot as plt\n", | |
"\n", | |
"import prettyplotlib as ppl\n", | |
"import numpy as np\n", | |
"%matplotlib inline" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 5 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"theFuck = df({'names':['twenty','ten','thirty','fifty','forty'], 'values':[20,10,30,50,40]})\n", | |
"# since I'm making a horizontal bar and they load from bottom\n", | |
"# up I need to sort ascending\n", | |
"\n", | |
"ypos = np.arange(len(theFuck)) + .1\n", | |
"with ppl.pretty:\n", | |
" fig, ax = plt.subplots(1, figsize=(10,6))\n", | |
"\n", | |
"ppl.barh(ax, ypos, theFuck['values'], annotate=True)\n", | |
"plt.yticks(ypos +.4, theFuck['names'])\n", | |
"plt.xlim(0, max(theFuck['values'])*1.1)\n", | |
"plt.title(\"Just some names and values\", fontsize=20)\n", | |
"plt.xlabel(\"values\")\n", | |
"plt.show()\n", | |
"print(theFuck)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "display_data", | |
"png": "iVBORw0KGgoAAAANSUhEUgAAAmIAAAGOCAYAAAA0OG+CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYHGW59/FvT4awRHYSQ1ROnAhCcBJQ3NCYYVGjCMQ3\nAZMIEvQIJCKihyjEo+G8LvDCeQXcIMoSFpMgGWVRjkYgYZFdQhwBFUYBISGyKhNJgOk+fzzVTKfT\nPZnJLPcs3891zdXdVdVVd3d1T/3meZ6qAUmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSpB5xOpAH\nPhBcR9FMUj3HBNchdYua6AKkHpTPfnp7m8t6eZvSYFSILkDqDgYxDXQRv6w9QEiSOsQgJkmSFMQg\npsGmgdR9OK/K/EeBv5ZNqwWmAD8E/gSszZa5GjgoW2Ymbd2gxW0Uf6ptq9QbgROBnwPPAc8CvwfO\nB3YqWzYHfA64OVvub8AvS2opNTqr4RJgJHAR8EfgSeDHwO7ZctsBZwH3AC8Ay4G3t1PvDODX2Xqe\nIXXHfrIDr7PUctres5Oy1/NP4AHgq1T+/TQZuAL4M9ACrAZuaWfbC7Jt/BtpTNFvSO/vcmBWyXKH\nAFcBfwceAc4AhlRZ50hgPrACeBF4CLgYeH2FZXcG/h1YBKwBnie9/5cAb66y/nIHAD8CHgT+QXq/\nbye9Z5Xeo9NJr3ki8GHgWuBp0mf7YmCHKtt5C9BI2qePZTXv3cEai36VbXtclfmfyOafVTLtHcB5\nwErS5/kF4N7sdWzZiW23NyxgQTZ/twrzdid9pv5A2p8rgXOBbSss25nvqSQNenmgtWxaQzb961We\n8yjwl7Jp87PnPAIsJB2kL80eFw8o40mBK589/+slP5sa5DycFKZeAX4LfBc4B7iGdGAYW7JsDXB9\ntp0/Ad8jHWSezl7r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oAkSVJ/NRa4HfgT8Hrg\nk8DF2bwZQJ7URQltXZNbAU8AryN1ZT5DW9fkb4ApQA7YIlt/Dhhd8tzH2TDISVKHOFhf0kDzIClQ\nPQGsAa4GdgAeAt6fzS8qnjW5DjgLuJMU2paWLDMbOIDU7bkCeC+ppexy4PfAjaSTAtb3xIuRJEmS\nJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEkS8L8AecQAidn2lAAAAABJRU5ErkJggg==\n", | |
"text": [ | |
"<matplotlib.figure.Figure at 0x1075bba90>" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
" names values\n", | |
"0 twenty 20\n", | |
"1 ten 10\n", | |
"2 thirty 30\n", | |
"3 fifty 50\n", | |
"4 forty 40\n" | |
] | |
} | |
], | |
"prompt_number": 6 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"So far so good. The data frame is built with data in the wrong order and the graph plots as expected. The labels match up with the values. But what happens if we sort the data frame and then plot it?" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"theFuck = theFuck.sort(['values'], ascending=True)\n", | |
"ypos = np.arange(len(theFuck)) + .1\n", | |
"with ppl.pretty:\n", | |
" fig, ax = plt.subplots(1, figsize=(10,6))\n", | |
"\n", | |
"ppl.barh(ax, ypos, theFuck['values'], annotate=True)\n", | |
"plt.yticks(ypos +.4, theFuck['names'])\n", | |
"plt.xlim(0, max(theFuck['values'])*1.1)\n", | |
"plt.title(\"Just some names and values\", fontsize=20)\n", | |
"plt.xlabel(\"values\")\n", | |
"plt.show()\n", | |
"print(theFuck)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "display_data", | |
"png": "iVBORw0KGgoAAAANSUhEUgAAAmIAAAGOCAYAAAA0OG+CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJRE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Jggg==\n", | |
"text": [ | |
"<matplotlib.figure.Figure at 0x1075f9210>" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
" names values\n", | |
"1 ten 10\n", | |
"0 twenty 20\n", | |
"2 thirty 30\n", | |
"4 forty 40\n", | |
"3 fifty 50\n" | |
] | |
} | |
], | |
"prompt_number": 7 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"What the what? The bars are now in sorted order and the values are what I would expect. However, it looks like the labels retained their original, unsorted, order. Even weirder, though, is the printout of the data frame below the bar chart where the values and the names **are** lined up." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment