From 5af7c30f84b8c7878d9b40764c2ab01a3d117532 Mon Sep 17 00:00:00 2001 From: Balaji Veeramani Date: Fri, 23 Sep 2022 14:12:59 -0500 Subject: [PATCH] Initial commit --- doc/source/data/doc_code/creating_datasets.py | 23 +++++++++++++++--- python/ray/data/examples/data/iris.tfrecords | Bin 0 -> 21500 bytes 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 python/ray/data/examples/data/iris.tfrecords diff --git a/doc/source/data/doc_code/creating_datasets.py b/doc/source/data/doc_code/creating_datasets.py index b6cabc733a07..fdd27da5063e 100644 --- a/doc/source/data/doc_code/creating_datasets.py +++ b/doc/source/data/doc_code/creating_datasets.py @@ -593,9 +593,24 @@ # __read_tfrecords_begin__ # Create a tabular Dataset by reading a TFRecord file. -ds = ray.data.read_tfrecords(path) -# -> Dataset(num_blocks=10, num_rows=150, schema={length: float64, width: float64, species: object}) - +ds = ray.data.read_tfrecords("example://iris.tfrecords") +# Dataset( +# num_blocks=1, +# num_rows=150, +# schema={ +# sepal.length: float64, +# sepal.width: float64, +# petal.length: float64, +# petal.width: float64, +# label: object, +# }, +# ) ds.show(1) -# -> {'length': 5.1, 'width': 3.5, 'species': b'setosa'} +# { +# "sepal.length": 5.099999904632568, +# "sepal.width": 3.5, +# "petal.length": 1.399999976158142, +# "petal.width": 0.20000000298023224, +# "label": b"Setosa", +# } # __read_tfrecords_end__ diff --git a/python/ray/data/examples/data/iris.tfrecords b/python/ray/data/examples/data/iris.tfrecords new file mode 100644 index 0000000000000000000000000000000000000000..d7fbf978627ff644b9f194ef3ac59ce3cb4e8be5 GIT binary patch literal 21500 zcmcJXeQ;IP6~%8=Qn)10CXf^+(lqiVUp2jPES&4=n2dwF?hrZeZPJ?q}6 z|GtUyduy+~_d4gip~mX@uW;77mG*M`OLk&aaYbR-gtFrDlIlgteUlUHTO4Owj-6)r z@A>4h(uL{+%PPpZ@h26<)!LslPr30YJ)ivFpF|_MlkF6{Pg!A6aapo$_q7x9imR7Y z6<%vy*j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