Linked Questions

1 vote
2 answers
2k views

I have millions of strings scraped from web like: s = 'WHAT\xe2\x80\x99S UP DOC?' type(s) == str # returns True Special characters like in the string above are inevitable when scraping from the web. ...
pg2455's user avatar
  • 5,258
1 vote
1 answer
3k views

I'm trying to python 2.7.6 with ElementTree to parse an xml file which is encoded in unicode from some server, and save the contained data locally. import xml.etree.ElementTree as ET def normalize(...
Roland's user avatar
  • 537
2 votes
2 answers
1k views

I imported the data from a database df = spark.read.format("com.mongodb.spark.sql.DefaultSource").option("uri", "mongodb://127.0.0.1/test.db").load() I have selected the double columns using ...
PolarBear10's user avatar
  • 2,325
0 votes
2 answers
866 views

I would like to strip all of the the punctuations (except the dot) from the beginning and end of a string, but not in the middle of it. For instance for an original string: @#%%.Hol$a.A.$% I would ...
user2288043's user avatar
1 vote
3 answers
1k views

I have the list lst= ["is ", "star,", "the-"] and I want to remove ',', '-' without using re. I used the below and it works but I wondered if there is something simpler: ...
eponkratova's user avatar
0 votes
1 answer
1k views

I want to copy the file to a new place in windows7 64bit. But I found some special characters in the file name can cause error 22 when using shutil.copy2 (but this file is legal in windows GUI and can ...
Joe E's user avatar
  • 1
0 votes
2 answers
745 views

I have an excel file that I want to push a sheet to database SQL, But before to push the data I want to replace or remove all Special chacater like brackets (), % and Spaces.. So for example I have a ...
Mahmoud Al-Haroon's user avatar
3 votes
1 answer
643 views

Is there a correct way to use parameters in a SQL injection safe way with the InfluxDB python client, much like the mogrify function in psycopg? https://github.com/influxdata/influxdb-python/ http://...
André C. Andersen's user avatar
1 vote
2 answers
821 views

So I have a df that looks like this: Text ___________________________ Hello, Jim. I knew it was Sam! Sam why?! I have a known list of names I want to extract from each row if they appear, and ...
still_coding's user avatar
0 votes
1 answer
816 views

I am trying to match a value of a json file in my python code to another value of another API call within the same code itself. The values basically the same but it does not match because sometimes ...
Moh's user avatar
  • 101
0 votes
2 answers
527 views

Post interim dataframe transformations, if we need to place a safety mechanism to remove special random characters from complete pandas dataframe. What would be the best way ? Example DF : data = {'...
Amit Singh's user avatar
2 votes
1 answer
161 views

I've read quite a few posts here about this, but I'm very new to Python in general so I was hoping for some more info. Essentially, I'm trying to write something that will pull word definitions from ...
Josh's user avatar
  • 47
-3 votes
1 answer
149 views

when im parsing a lot of data with python and it can happen that some parts of the data contains strings/chars with \, this can lead to problems when working with the data so my goal is minimize ...
SemperVirens's user avatar
-1 votes
1 answer
170 views

So i'm writing a python discord bot that uses yt-dlp to download a song then send it to a discord channel. Problem is, I need to save the mp3 to a path to reupload it, but i think my code would be ...
Alexis Leclerc's user avatar
0 votes
3 answers
74 views

I am new to python and I would like to print different words from the sentence. Below is the text file Test.txt 1. As more than one social media historian has reminded few people, the Stonewall ...
sri's user avatar
  • 75

15 30 50 per page