{ "cells": [ { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "import random\n", "import re\n", "with open('test-A/in.tsv', 'r') as f_in:\n", " with open('test-A/out.tsv', 'w') as f_out:\n", " for line in f_in:\n", " v = random.choice(re.split(\" |\\n|\\t\", line)[50:])\n", " f_out.write(f'{v}:0.9 :0.1\\n')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3.9.12 ('base')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "775a359a5b6f42820cb11dff2e8c0375cba15e7c633731e5cd1af5f5882e2e16" } } }, "nbformat": 4, "nbformat_minor": 2 }