From 0dfb6cd7f6e4d90e4ae81e587293865108a360ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=86=9B?= <1024307957@qq.com> Date: Tue, 21 Jul 2020 22:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E4=BB=BB=E5=8A=A1=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- student_task.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 student_task.py diff --git a/student_task.py b/student_task.py new file mode 100644 index 0000000..ae00db0 --- /dev/null +++ b/student_task.py @@ -0,0 +1,13 @@ +multi_func = lambda x : x*10 + +def data_pre_handle(data): + # 对输入数据依次执行以下操作,然后作为返回值输出 + # 1. 映射,使用上面的multi_func函数作为参数 + # 2. 分组,每3个分为一组,末尾不足一组的砍掉 + # 3. 重复,将数据重复3次 + ########## Begin ########## + map_res = data.map(operations=multi_func) + batch_res = map_res.batch(batch_size=3, drop_remainder=True) + repeat_res = batch_res.repeat(3) + return repeat_res + ########## end ########## \ No newline at end of file