python-unicode Questions

3

Solved

I cleaned 400 excel files and read them into python using pandas and appended all the raw data into one big df. Then when I try to export it to a csv: df.to_csv("path",header=True,index=False) ...
Guizot asked 10/7, 2015 at 2:9

3

I'm new with python. I'm trying to run this code: llaves=("España","Francia","Inglaterra") dicPaises={llaves[0]:"Madrid",llaves[1]:"Paris",llaves[2...

13

Solved

I have a socket server that is supposed to receive UTF-8 valid characters from clients. The problem is some clients (mainly hackers) are sending all the wrong kind of data over it. I can easily dis...
Whopper asked 17/9, 2012 at 22:55

7

I tried this code in Python 2: def NewFunction(): return '£' But I get an error message that says: SyntaxError: Non-ASCII character '\xa3' in file '...' but no encoding declared; see http://www.p...
Consubstantiate asked 14/5, 2012 at 19:12

4

This question has been asked here Python : How to remove all emojis Without a solution, I have as step towards the solution. But need help finishing it off. I went and got all the emoji hex code p...
Radium asked 6/7, 2018 at 21:36

8

Solved

I have a function like this: persian_numbers = '۱۲۳۴۵۶۷۸۹۰' english_numbers = '1234567890' arabic_numbers = '١٢٣٤٥٦٧٨٩٠' english_trans = string.maketrans(english_numbers, persian_numbers) arabic_t...
Roughshod asked 9/8, 2012 at 7:56

3

Solved

Following is sample code, aim is just to merges text files from give folder and it's sub folder. i am getting Traceback occasionally so not sure where to look. also need some help to enhance the co...
Hampshire asked 31/8, 2012 at 10:4

5

Solved

I am trying to read twitter data from json file using python 2.7.12. Code I used is such: import json import sys reload(sys) sys.setdefaultencoding('utf-8') def get_tweets_from_file(file_nam...
Crosscurrent asked 22/7, 2016 at 4:11

3

I have two files both at the same directory: http://nlp.lsi.upc.edu/awn/AWNDatabaseManagement.py.gz the xml database of Arabic WordNet (http://nlp.lsi.upc.edu/awn/get_bd.php) upc_db.xml When i ...
Vanadium asked 27/10, 2020 at 19:12

5

Solved

I enabled the compatibility check in my Python IDE and now I realize that the inherited Python 2.7 code has a lot of calls to unicode() which are not allowed in Python 3.x. I looked at the docs of...
Paternity asked 1/8, 2016 at 10:55

4

I'm trying to load a csv file using pd.read_csv but I get the following unicode error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 3: invalid continuation byte
Semidome asked 3/8, 2017 at 19:10

10

I want to make a dictionary where English words point to Russian and French translations. How do I print out unicode characters in Python? Also, how do you store unicode chars in a variable?
Strangulation asked 13/5, 2012 at 5:0

6

Solved

Strange error from numpy via matplotlib when trying to get a histogram of a tiny toy dataset. I'm just not sure how to interpret the error, which makes it hard to see what to do next. Didn't find ...
Probability asked 15/4, 2016 at 2:47

34

Solved

I'm having problems dealing with unicode characters from text fetched from different web pages (on different sites). I am using BeautifulSoup. The problem is that the error is not always reproduc...

3

I'm trying to automate a series of queries but, I need to replace characters with accents with the corresponding html entity. It needs to be in Python3 Example: vèlit [needs to become] v&egra...
Kalvin asked 10/5, 2018 at 18:56

2

Solved

I am trying to use python to sort through my downloaded Instagram data, the data is a json file, but emoji and other non-text characters are encoded in a way I do not understand, for example: The j...
Pessimist asked 2/3, 2021 at 15:34

3

Solved

I am trying to pull a list of 500 restaurants in Amsterdam from TripAdvisor; however after the 308th restaurant I get the following error: Traceback (most recent call last): File "C:/Users/dtrinh...
Dryad asked 15/11, 2016 at 21:5

2

Solved

Am trying to a run this piece of code, and it keeps giving an error saying "String argument without an encoding" ota_packet = ota_packet.encode('utf-8') + bytearray(content[current_pos:(final_pos)...
Lippold asked 1/7, 2015 at 12:24

3

Solved

I'am trying to get running a very simple example on OSX with python 3.5.1 but I'm really stucked. Have read so many articles that deal with similar problems but I can not fix this by myself. Do you...
Biographer asked 10/8, 2016 at 20:15

2

Solved

I have some troubles with a dataframe obtained from reading a xls file. Every data on such dataframe has the type 'unicode' and I can't do anything with this. I wanna change it to str values. Also,...
Guinna asked 23/2, 2017 at 17:2

3

Solved

The key field in an AWS S3 notification event, which denotes the filename, is URL escaped. This is evident when the filename contains spaces or non-ASCII characters. For example, I have upload t...
Alack asked 13/9, 2016 at 8:14

4

Solved

This code: for root, dirs, files in os.walk('.'): print(root) Gives me this error: UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 27: surrogates not allowed Ho...
Sixtieth asked 8/12, 2014 at 20:38

0

I have in Django view the following string string = "'DE', 'FR', 'IT'" which is transfered to a template: return render(request, 'template.html', {'string':string}) In the template I get this...
Godding asked 26/3, 2020 at 20:47

3

Solved

so okay, as the title suggests the problem I have is with correctly reading input from a windows-1252 encoded file in python and inserting said input into SQLAlchemy-MySql table. The current syste...
Mid asked 19/3, 2013 at 14:45

4

Solved

I have some data in CSV file that are in Russian: 2-комнатная квартира РДТ', мкр Тастак-3, Аносова — Толе би;Алматы 2-комнатная квартира БГР', мкр Таугуль, Дулати (Навои) — Токтабаева;Алматы 2-ком...
Electroanalysis asked 30/11, 2015 at 10:31

© 2022 - 2025 — McMap. All rights reserved.