0

I have read a csv file in which there are many values which have been read as unicode. While doing my data processing, I want to skip these values. Existing Code:

if aString.encode('ascii', 'ignore') == b'':
    continue

The same code is working when i am trying this in python environment. But it is not working in script(.py file).

enter image description here

Pulkit Jha
  • 1,709
  • 3
  • 12
  • 18
  • https://stackoverflow.com/questions/46154561/remove-unicode-character-from-python-string I saw an answer here. – Pulkit Jha Jan 26 '19 at 14:30
  • Try to just print the string in both envs. Check the diferences. Try again printing the ord number of the character and check differences again. I assume there is some problem on your environment (are you sure that py files are excuted by python3?) – Giacomo Catenazzi Jan 26 '19 at 17:28
  • 1
    Show a reproducible example of your script. Read and follow [mcve] – Mark Tolonen Jan 26 '19 at 19:06

0 Answers0