Metadata-Version: 2.1
Name: sfplot
Version: 0.0.1
Summary: Search records of pandas dataframe from plot.
Home-page: https://gitlab.com/kegeppa
Author: kegeppa
Author-email: 
Maintainer: kegeppa
Maintainer-email: 
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: matplotlib

Search From Plot
================

概要
----

| 散布図または箱ひげ図からデータを抽出することができます
| 関数を呼び出すと、tkウィンドウが立ち上がります
| ウィンドウに表示された図上をドラッグすることで範囲を指定でき、
| 範囲内にプロットされているデータをDataFrameで受け取ることができます

jupyter notebook上で使うことを想定しています

インストール
------------

.. code:: bash

    $ pip install sfplot

使い方
------

サンプルデータにirisデータセットを利用します

.. code:: python

    from sklearn.datasets import load_iris
    import seaborn as sns
    iris_dataset = sns.load_dataset('iris')
    iris_dataset.head(10)

|image0|

対散布図からデータを抽出
~~~~~~~~~~~~~~~~~~~~~~~~

-  | pandas
     DataFrameと、散布図にしたいカラム名を引数にしてSearchFromPlotを起動します
   | 引数x,yには数値(int, float)型のカラムのみ指定可能です

   .. code:: python

       import sfplot
       search_result_df = sfplot.scatter(iris_dataset, x='sepal_length', y='sepal_width')

-  | ウィンドウが起動します
   | |image1|

-  | 取得したいデータの範囲をドラッグします
   | |image2|

-  | 「4件取得」と書かれたボタンを押下すると、ウィンドウが閉じ、
   | 選択範囲内のレコードを抽出したDataFrameを返却します

   .. code:: python

       search_result_df

   |image3|

-  | 一度に複数回範囲を選択することも可能です
   | |image4|
   | |image5|

箱ひげ図からデータを抽出
~~~~~~~~~~~~~~~~~~~~~~~~

-  | pandas
     DataFrameと、箱ひげ図にしたいカラム名を引数にしてSearchFromPlotを起動します
   | 引数xにはobject型のカラム、引数yには数値(int,
     float)型のカラムのみ指定可能です

   .. code:: python

       search_result_df = sfplot.boxplot(iris_dataset, x='species', y='sepal_width')

-  | ウィンドウが起動します
   | |image6|

-  操作方法は対散布図と同様です

.. |image0| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_01.png
.. |image1| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_02.png
.. |image2| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_03.png
.. |image3| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_04.png
.. |image4| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_05.png
.. |image5| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_06.png
.. |image6| image:: https://gitlab.com/kegeppa/public/raw/master/SearchFromPlot/.sample_images/image_07.png



