Skip to main content

Render a dataset into a picture

Project description

hishiryo

Consciousness beyond thought ^_^

Hishiryo is a tool to generate a circular dataviz of any csv dataset.

This little experiment aims at trying to quickly represent the content of a dataset and make it funny to discover it's patterns!

Each datapoint (like a cell in an excel sheet) is converted into a pixel , and this pixel is diplayed on a circular graph.

This version supports the following column data formats : float, integers and text as nominal categories.

How to install

With PyPI (Make sure your pip is up to date as it can interfere with CV2 package install)

pip install hishiryo

Dependencies

  • Pandas
  • CV2 (OpenCV)
  • Pillow
  • svgwrite

How to use radial rendering

1 - find an appropriate csv. (more than 100 rows will start to overload the result a little)

2 - From your code or from a Jupyter notebook :

from hishiryo import Hishiryo

HishiryoConverter = Hishiryo.Hishiryo()

input_path = "/home/user/iris.csv"
separator = ','
output_path = "/home/user/iris.png"
radius = 500

HishiryoConverter.convertCSVToRadialBitmap(input_path,separator,output_path,radius,None,"Dot")

Arguments :

  • input path is the path to your csv file (e.g. /home/user/iris.csv)

  • output path is the path to your target image file (e.g. /home/user/iris.png) The fileformat you want is autodetected thanks to CV2 functionalities.

  • separator is the character separator in your csv (e.g. ",")

  • radius (in pixel) is the size of the radius of the disk where the pixels will be drawn. The higher it is the bigger and sharper your output image will be. (e.g: 1500)'

  • sort_by is the name of the column or the list of column you want to sort you data. (e.g. "Sepal.Length", or ["Sepal.Length","Sepal.Width"])

  • glyph_type is the type of representation you want for the pixels. it can be one among the following : "Dot","Square" or "Polygon"

      input_path = "path/to/your/csv/file.csv"
      output_path = "path/to/your/rendered/image.png"
      separator = ","
      radius = 3000
      sort_by = None
      glyph_type = "Polygon"
    

Colors are assigned based on the variable type.

  • Blue circles represent integer values
  • Red circles, float values
  • Random colors are assigned to categorical variables.
  • Black is the default value for value 0 or when there is no data

Radial bitmap rendering examples

See below an example of a visualisation generated from the train titanic dataset output example

The 12 columns of the dataset are represented as 12 circular rows. The first column is rendered as the inner circle, and the last as the outer one.

Here is an overview of the MNIST train dataset, sort by label output example

How to use simple bitmap rendering

Another way is to render your csv as a simple bitmap, without radial representation.

from hishiryo import Hishiryo

HishiryoConverter = Hishiryo.Hishiryo()

input_path = "/home/user/iris.csv"
separator = ','
output_path = "/home/user/iris.png"

HishiryoConverter.convertCSVToBitmap(input_path,
                                     output_path,
                                     separator,
                                     )

simple bitmap rendering example

Here is an extract of the MNIST test dataset () output example

Licence

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hishiryo-0.0.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hishiryo-0.0.4-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file hishiryo-0.0.4.tar.gz.

File metadata

  • Download URL: hishiryo-0.0.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for hishiryo-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ba0e3725da6f6a9098ddfcef1ba6b9f7b16f0ccef5ae447289989653a09253af
MD5 a0d8a3ac02b13e8e1928772a5b9f7904
BLAKE2b-256 b3378e1e897c8a3321123b08fad9855be8298e3736f1b09e2120f115fafcfbb7

See more details on using hashes here.

File details

Details for the file hishiryo-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: hishiryo-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for hishiryo-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3607547694a3ffb16f94318303c772b8974dcb39613bac9c4d35bd2c3d3cd071
MD5 eebf04b719018235a72646c00a7bde52
BLAKE2b-256 2cd89cdee68728401687d35816e0c73dbe618ad7a8708c9666aaaa7f3faa0470

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page