From 9f6918979e7244023d1387162e06dd72a0f5b381 Mon Sep 17 00:00:00 2001 From: stas-sl Date: Thu, 18 Sep 2014 00:05:25 +0300 Subject: [PATCH] fix variable overwriting in radviz The variable `n` is set to number of rows in dataframe, and then it overwritten with number of columns, but after that there is loop that should iterate over rows and it uses new value in `n` that holds number of columns already. --- doc/source/v0.15.0.txt | 1 + pandas/tools/plotting.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/source/v0.15.0.txt b/doc/source/v0.15.0.txt index 6db3fcaa832c0..92eeb4b76df8b 100644 --- a/doc/source/v0.15.0.txt +++ b/doc/source/v0.15.0.txt @@ -920,3 +920,4 @@ Bug Fixes - Bug in plotting methods modifying the global matplotlib rcParams (:issue:`8242`). - Bug in ``DataFrame.__setitem__`` that caused errors when setting a dataframe column to a sparse array (:issue:`8131`) - Bug where ``Dataframe.boxplot()`` failed when entire column was empty (:issue:`8181`). +- Bug with messed variables in ``radviz`` visualization (:issue:`8199`). diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index 0c150074a9298..328e392c3d8b7 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -405,10 +405,10 @@ def normalize(series): for kls in classes: to_plot[kls] = [[], []] - n = len(frame.columns) - 1 + m = len(frame.columns) - 1 s = np.array([(np.cos(t), np.sin(t)) - for t in [2.0 * np.pi * (i / float(n)) - for i in range(n)]]) + for t in [2.0 * np.pi * (i / float(m)) + for i in range(m)]]) for i in range(n): row = df.iloc[i].values