From b98d84f826d3ffdb8aa7252f5120511ff9dbcab1 Mon Sep 17 00:00:00 2001 From: Michael Chavinda Date: Sun, 29 Dec 2024 11:10:28 -0800 Subject: [PATCH] Show example output in Readme. --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 08d918e..2ce1865 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,11 @@ The library is still in active development with a v0.1 launch planned for March import qualified Data.DataFrame as D import Data.DataFrame ((|>)) +import Data.Text (Text) main :: IO () df <- D.readTsv "./data/chipotle.tsv" - let searchTerm = "Chicken Burrito" :: T.Text + let searchTerm = "Chicken Burrito" :: Text print $ df |> D.select ["item_name", "quantity"] |> D.filter "item_name" (searchTerm ==) @@ -35,6 +36,26 @@ main :: IO () |> D.sortBy D.Descending "Sum_quantity" ``` +Output: + +``` +---------------------------------------------------------------------------------------------------- +index | item_name | Sum_quantity | Mean_quantity | Maximum_quantity +------|---------------------------------------|--------------|--------------------|----------------- + Int | Text | Int | Double | Int +------|---------------------------------------|--------------|--------------------|----------------- +0 | Chips and Fresh Tomato Salsa | 130 | 1.1818181818181819 | 15 +1 | Izze | 22 | 1.1 | 3 +2 | Nantucket Nectar | 31 | 1.1481481481481481 | 3 +3 | Chips and Tomatillo-Green Chili Salsa | 35 | 1.1290322580645162 | 3 +4 | Chicken Bowl | 761 | 1.0482093663911847 | 3 +5 | Side of Chips | 110 | 1.0891089108910892 | 8 +6 | Steak Burrito | 386 | 1.048913043478261 | 3 +7 | Steak Soft Tacos | 56 | 1.018181818181818 | 2 +8 | Chips and Guacamole | 506 | 1.0563674321503131 | 4 +9 | Chicken Crispy Tacos | 50 | 1.0638297872340425 | 2 +``` + Full example in `./app` folder using many of the constructs in the API. ### Visual example