我有熊猫这个数据帧:删除HTML代码大熊猫单元格格
import pandas as pd
df = pd.DataFrame({'CARGO': {53944: 'Driver',
57389: 'Driver',
60851: 'Driver',
64322: 'Driver',
67771: 'Driver'},
'DATE': {53944: '05/2015',
57389: '06/2015',
60851: '07/2015',
64322: '08/2015',
67771: '09/2015'},
'DESCRICAO': {53944: '\\Salario R$ 788,00\nGratificacao Adicional R$ 251,00\nGRATIFICAÇÃO R$ 512,00\nINSS R$ -104,00',
57389: '\\Salario R$ 788,00\nGratificacao Adicional R$ 251,00\nGRATIFICAÇÃO R$ 512,00\nINSS R$ -104,00',
60851: '\\Salario R$ 788,00\n1/3 de Ferias R$ 516,95\nGratificacao Adicional R$ 251,00\nGRATIFICAÇÃO R$ 512,00\nINSS R$ -104,00',
64322: '\\Salario R$ 788,00\nGratificacao Adicional R$ 251,00\nGRATIFICAÇÃO R$ 512,00\nINSS R$ -104,00',
67771: '\\Salario R$ 788,00\nGratificacao Adicional R$ 225,90\nGRATIFICAÇÃO R$ 512,00\nINSS R$ -104,00'},
'NOME': {53944: 'John Smith',
57389: 'John Smith',
60851: 'John Smith',
64322: 'John Smith',
67771: 'John Smith'}})
它呈现这样的输出:
我如何建立大熊猫或Jupyter所以它会: 1. display plaintext 2. accept line break('\ n')
你能举一个例子说明你想如何格式化明文吗 – akaihola
我编辑了这个问题在单元格末尾的backslah“\”是一个意外,但我没有改变它会使事情变得复杂。 – nicmano