All Questions
7 questions
0
votes
1
answer
36
views
How do I add to strings in a list? (scraping links off Amazon)
I'm trying to scrape links off of Amazon. I ran into a tiny problem.
I wish to add a particular string 'a' to every string in a list.
links = soup.find_all("a", attrs= {"class"...
1
vote
3
answers
3k
views
Split list of text in pandas dataframe
I have pandas dataframe consist of list of text, i want to split the text by ,
df['c1']=['this is text one','this is text two','this is text three']
I tried this
new = df["c1"].str.split(",", n = 1, ...
-1
votes
1
answer
213
views
search a specific item of a list in a string python
I have two strings:
a = "The quick brown fox did jump over a log"
b = "The brown rabbit quickly did outjump the fox"
both of which have been converted into lists at each space. I want to make a for ...
-3
votes
2
answers
152
views
compare list of words, similar words deleted and added into new string
I have 2 strings which I have converted into a list of words A and B. I am trying to make an algorithm that selects a word starting from the left. If that word appears as a word or part of a word in ...
0
votes
1
answer
28
views
Splitting a string in Python based on a regex pattern
I have a bytes object that contains urls:
> body.decode("utf-8")
> 'https://www.wired.com/story/car-news-roundup-tesla-model-3-sales/\r\n\r\nhttps://cleantechnica.com/2018/11/11/can-you-still-...
0
votes
2
answers
39
views
Issue with variables in insert statement in python 3
This is regarding hackerrank problem https://www.hackerrank.com/challenges/python-lists/problem .Below is my implemented code. I am facing issue with the insert statement as it is asking for at least ...
0
votes
1
answer
86
views
Separating a list of strings into columns
import textwrap
def get_coord(x,matrix):
code = 'ADFGVX'
for i in range(len(matrix)):
for a in range(len(matrix[i])):
if matrix[i][a] == x:
...