README.md in red_amber-0.2.3 vs README.md in red_amber-0.3.0

- old
+ new

@@ -1,24 +1,27 @@ # RedAmber [![Gem Version](https://badge.fury.io/rb/red_amber.svg)](https://badge.fury.io/rb/red_amber) -[![Ruby](https://github.com/heronshoes/red_amber/actions/workflows/ci.yml/badge.svg)](https://github.com/heronshoes/red_amber/actions/workflows/ci.yml) +[![CI](https://github.com/heronshoes/red_amber/actions/workflows/ci.yml/badge.svg)](https://github.com/heronshoes/red_amber/actions/workflows/ci.yml) +[![Maintainability](https://api.codeclimate.com/v1/badges/b8a745047045d2f49daa/maintainability)](https://codeclimate.com/github/heronshoes/red_amber/maintainability) +[![Test coverage](https://api.codeclimate.com/v1/badges/b8a745047045d2f49daa/test_coverage)](https://codeclimate.com/github/heronshoes/red_amber/test_coverage) +[![Doc](https://img.shields.io/badge/docs-latest-blue)](https://heronshoes.github.io/red_amber/) [![Discussions](https://img.shields.io/github/discussions/heronshoes/red_amber)](https://github.com/heronshoes/red_amber/discussions) A simple dataframe library for Ruby. -- Powered by [Red Arrow](https://github.com/apache/arrow/tree/master/ruby/red-arrow) [![Gitter Chat](https://badges.gitter.im/red-data-tools/en.svg)](https://gitter.im/red-data-tools/en) +- Powered by [Red Arrow](https://github.com/apache/arrow/tree/master/ruby/red-arrow) +[![Gitter Chat](https://badges.gitter.im/red-data-tools/en.svg)](https://gitter.im/red-data-tools/en) - Inspired by the dataframe library [Rover-df](https://github.com/ankane/rover) -![screenshot from jupyterlab](doc/image/screenshot.png) +![screenshot from jupyterlab](https://raw.githubusercontent.com/heronshoes/red_amber/main/doc/image/screenshot.png) ## Requirements -Supported Ruby version is >= 2.7. +Supported Ruby version is >= 3.0 (since RedAmber 0.3.0). -Since v0.2.0, this library uses pattern matching which is an experimental feature in 2.7 . It is usable but a warning message will be shown in 2.7 . -I recommend Ruby 3 for performance. +- I decided to remove Ruby 2.7 without waiting for EOL because it cannot solve the problem of simultaneous use of Hash and keyword arguments when implementing DataFrame#join. ```ruby # Libraries required gem 'red-arrow', '~> 10.0.0' # Requires Apache Arrow (see installation below) @@ -35,30 +38,39 @@ - Apache Parquet GLib (~> 10.0.0) # If you use IO from/to parquet See [Apache Arrow install document](https://arrow.apache.org/install/). - Minimum installation example for the latest Ubuntu: - ``` - sudo apt update - sudo apt install -y -V ca-certificates lsb-release wget - wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb - sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb - sudo apt update - sudo apt install -y -V libarrow-dev - sudo apt install -y -V libarrow-glib-dev - ``` - - On macOS, you can install Apache Arrow C++ library using Homebrew: - - ``` - brew install apache-arrow - ``` + ``` + sudo apt update + sudo apt install -y -V ca-certificates lsb-release wget + wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb + sudo apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb + sudo apt update + sudo apt install -y -V libarrow-dev + sudo apt install -y -V libarrow-glib-dev + ``` + + - On Fedora 38 (Rawhide): + + ``` + sudo dnf update + sudo dnf -y install gcc-c++ libarrow-devel libarrow-glib-devel ruby-devel + ``` + + - On macOS, you can install Apache Arrow C++ library using Homebrew: + + ``` + brew install apache-arrow + ``` + and GLib (C) package with: - ``` - brew install apache-arrow-glib - ``` + ``` + brew install apache-arrow-glib + ``` If you prepared Apache Arrow, add these lines to your Gemfile: ```ruby gem 'red-arrow', '~> 10.0.0' @@ -82,21 +94,26 @@ ## Data frame in `RedAmber` Class `RedAmber::DataFrame` represents a set of data in 2D-shape. The entity is a Red Arrow's Table object. -![dataframe model of RedAmber](doc/image/dataframe_model.png) +![dataframe model of RedAmber](https://raw.githubusercontent.com/heronshoes/red_amber/main/doc/image/dataframe_model.png) Let's load the library and try some examples. ```ruby require 'red_amber' # require 'red-amber' is also OK. include RedAmber ``` ### Example: diamonds dataset +First do (if you do not installed) ` +gem install red-datasets-arrow +` +then + ```ruby require 'datasets-arrow' # to load sample data dataset = Datasets::Diamonds.new diamonds = DataFrame.new(dataset) # from v0.2.2, should be `dataset.to_arrow` if older. @@ -194,10 +211,10 @@ See [Vector.md](doc/Vector.md) for details. ## Jupyter notebook -[83 Examples of Red Amber](https://github.com/heronshoes/docker-stacks/blob/RedAmber-binder/binder/examples_of_red_amber.ipynb) +[89 Examples of Red Amber](https://github.com/heronshoes/docker-stacks/blob/RedAmber-binder/binder/examples_of_red_amber.ipynb) ([raw file](https://raw.githubusercontent.com/heronshoes/docker-stacks/RedAmber-binder/binder/examples_of_red_amber.ipynb)) shows more examples in jupyter notebook. You can try this notebook on [Binder](https://mybinder.org/v2/gh/heronshoes/docker-stacks/RedAmber-binder?filepath=examples_of_red_amber.ipynb). [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/heronshoes/docker-stacks/RedAmber-binder?filepath=examples_of_red_amber.ipynb)