Last active
October 18, 2023 10:23
-
-
Save luisgdelafuente/c3ae7c1755ca90da09bf90cc5dd15ce9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import textwrap\n", | |
"\n", | |
"# Generar resultados en pantalla\n", | |
"for paragraph in df['response']:\n", | |
" paragraphs = paragraph.split('\\n') # dividir en bloques \n", | |
" for p in paragraphs:\n", | |
" wrapped_paragraphs = textwrap.wrap(p, width=80) # ajustar anchura\n", | |
" for wrapped_p in wrapped_paragraphs:\n", | |
" print(wrapped_p)\n", | |
" print('-' * 50) # meter un separador" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"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.11.4" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment