<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
data = {'names':['<NAME>',
                 'jUAn GOMez 23',
                 '<NAME> 89',
                 '<NAME> 3',
                 '<NAME> 56',
                 '@freddier #platzi 10',pd.NA]}
df = pd.DataFrame(data)
df<jupyter_output><empty_output><jupyter_text>Convertir a minúsculas<jupyter_code>df['names'].str.lower()<jupyter_output><empty_output><jupyter_text>Convertir a mayúsculas<jupyter_code>df['names'].str.upper()<jupyter_output><empty_output><jupyter_text>Convertir solo la primera letra en mayúscula<jupyter_code>df['names'].str.capitalize()<jupyter_output><empty_output><jupyter_text>Contar la longitud del texto<jupyter_code>df['names'].str.len()<jupyter_output><empty_output><jupyter_text>Dividir el texto por espacio ' '<jupyter_code>df['names'].str.split(' ')<jupyter_output><empty_output><jupyter_text>Ó por un símbolo<jupyter_code>df['names'].str.split('#')<jupyter_output><empty_output><jupyter_text>Seleccionar los primeros 5 caracteres<jupyter_code>df['names'].str[:5]<jupyter_output><empty_output><jupyter_text>últimos 5 caracteres<jupyter_code>df['names'].str[-5:]
df['names'].str.replace('Alfredo','Cristian')
df['names'].str.findall('ara')
df['names'].str.contains('or')
df['names'].str.lower().str.count('a')
df['names'].str.extract('([0-9]+)',expand=False)
df['names'].str.replace('@[^\s]+','')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19057665260196907, 'fraction_numerical': 0.010548523206751054, 'mean_word_length': 7.03954802259887, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '295157', 'license': 'MIT', 'n_tokens_mistral': 561, 'n_tokens_neox': 559, 'n_words': 56, 'path': 'manipulacion_datos_pandas/6_manejo_variables_texto.ipynb', 'repo_name': 'cristian-rincon/escuela-datascience', 'size': '1453'}