Ho pulito 400 file excel e li ho letti in python utilizzando panda e aggiunto tutti i dati grezzi in un unico grande df.Errore di codifica Unicode durante la scrittura di pandas df su csv
Poi quando si tenta di esportare in un file CSV:
df.to_csv("path",header=True,index=False)
ottengo questo errore:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc7' in position 20: ordinal not in range(128)
Qualcuno può suggerire un modo per risolvere questo problema e che cosa significa?
Grazie
Indica se stai usando python 2 o 3, questi due gestiscono Unicode in modo molto diverso. Quindi leggi [howto in Unicode] (https://docs.python.org/3/howto/unicode.html), che fornisce un buon background per questo errore. Questi problemi non sono difficili da risolvere, ma devi prima conoscere le basi. – roeland
Sto usando python 2 –
https://docs.python.org/2.7/howto/unicode.html – marbel