<Python, pip> pipのアップグレード

seabornが待望の0.6をリリースしたようなので、Winpythonをアップグレードしようかなと、、

まずはローカルのバージョンチェック。

[501:~]>pip freeze | grep seaborn
You are using pip version 6.1.1, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
seaborn==0.5.1

pipも新版がでたらしい、、、ではお勧めにしたがいupgrade pip
が、なにやら、エラー出た。。。

[505:~]>pip install --upgrade pip
You are using pip version 6.1.1, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
  Downloading pip-7.1.0-py2.py3-none-any.whl (1.1MB)
Installing collected packages: pip
  Found existing installation: pip 6.1.1
    Uninstalling pip-6.1.1:
      Successfully uninstalled pip-6.1.1
  Exception:
  Traceback (most recent call last):
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 371, in _rmtree_unsafe
      os.unlink(fullname)
  PermissionError: [WinError 5] アクセスが拒否されました。: 'C:\\msys64\\tmp\\pip-0ezsj4q1-uninstall\\winpython-64bit-3.4.3.3\\python-3.4.3.amd                                                          64\\scripts\\pip.exe'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\basecommand.py", line 246, in main
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\commands\install.py", line 352, in run
      'a link. Pip will not automatically replace '
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\req\req_set.py", line 704, in install
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\req\req_install.py", line 743, in commit_uninstall
      )
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\req\req_uninstall.py", line 153, in commit
      self.save_dir = None
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
      return Retrying(*dargs, **dkw).call(f, *args, **kw)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\_vendor\retrying.py", line 212, in call
      raise attempt.get()
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\_vendor\retrying.py", line 247, in get
      six.reraise(self.value[0], self.value[1], self.value[2])
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\_vendor\six.py", line 659, in reraise
      raise value
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\_vendor\retrying.py", line 200, in call
      attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\utils\__init__.py", line 67, in rmtree
      def ensure_dir(path):
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 478, in rmtree
      return _rmtree_unsafe(path, onerror)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 368, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 368, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 368, in _rmtree_unsafe
      _rmtree_unsafe(fullname, onerror)
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\lib\shutil.py", line 373, in _rmtree_unsafe
      onerror(os.unlink, fullname, sys.exc_info())
    File "C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages\pip\utils\__init__.py", line 79, in rmtree_errorhandler
      return "%s -m pip" % sys.executable
  PermissionError: [WinError 5] アクセスが拒否されました。: 'C:\\msys64\\tmp\\pip-0ezsj4q1-uninstall\\winpython-64bit-3.4.3.3\\python-3.4.3.amd                                                          64\\scripts\\pip.exe'

こりゃ失敗? と思ったら、でもアップグレードされていた。。。

[510:~]>pip -V
pip 7.1.0 from C:\WinPython-64bit-3.4.3.3\python-3.4.3.amd64\Lib\site-packages (python 3.4)

わからん、、、 でも、まーいいや。。。

helpすると、使い方がでてくる。

[509:~]>pip help

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output.
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup.
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.

<Python, pip, seaborn> seaborn 0.6.0

seaborn 0.6.0が出た。いえーい。ちゅうことでアップグレード。

Seaborn: statistical data visualization — seaborn 0.6.0 documentation

[511:~]>pip search seaborn
seaborn              - Seaborn: statistical data visualization
  INSTALLED: 0.5.1
  LATEST:    0.6.0
pandas_confusion     - Pandas matrix confusion with plot features (matplotlib, seaborn...)
[512:~]>pip install --upgrade seaborn
Collecting seaborn
  Downloading seaborn-0.6.0.tar.gz (145kB)
Building wheels for collected packages: seaborn
  Running setup.py bdist_wheel for seaborn
  Stored in directory: C:\Users\hage\AppData\Local\pip\Cache\wheels\e6\92\84\a33c536c601c0ebd434caee8f8054f26390b32d36824c1e5d4
Successfully built seaborn
Installing collected packages: seaborn
  Found existing installation: seaborn 0.5.1
    Uninstalling seaborn-0.5.1:
      Successfully uninstalled seaborn-0.5.1
Successfully installed seaborn-0.6.0
[513:~]>pip freeze | grep seaborn
seaborn==0.6.0

確認。

In [1]: import seaborn as sns
   ...: sns.set(style="whitegrid", palette="pastel", color_codes=True)
   ...: 
   ...: # Load the example tips dataset
   ...: tips = sns.load_dataset("tips")
   ...: 
   ...: # Draw a nested violinplot and split the violins for easier comparison
   ...: sns.violinplot(x="day", y="total_bill", hue="sex", data=tips, split=True,
   ...:                inner="quart", palette={"Male": "b", "Female": "y"})
   ...: sns.despine(left=True)
   ...: 

f:id:nekoyukimmm:20150702091154p:plain

すばらしい!

<Python, seaborn> 0.6.0 での violinplot

みばがなんか変わったとおもったら、 0.6.0violinplotにちょとオプションが増えていた。。。

In [5]: sns.violinplot(vals=df['hage'], inner='quartile', groupby=None)

f:id:nekoyukimmm:20150702092927p:plain

In [6]: sns.violinplot(vals=df['hage'], inner='box', groupby=None)

f:id:nekoyukimmm:20150702092925p:plain

In [7]: sns.violinplot(vals=df['hage'], inner='point', groupby=None)

f:id:nekoyukimmm:20150702092928p:plain

In [8]: sns.violinplot(vals=df['hage'], inner='stick', groupby=None)

f:id:nekoyukimmm:20150702092924p:plain

で、どうもinnerを指定しない時のデフォルトは、boxっぽい。