Convert perl regex to python [closed] - python

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
The regex expression I'm trying to convert is
my $host =~m/([^.])(\.swiss\.ch)/)
But I'm not getting the desired result

Supposing you want to be able to match *.swiss.ch domains and addresses:
import re
preg = re.compile(r'([^\.]+)\.swiss\.ch')

Related

ValueError: malformed node or string while converting string to list [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
import ast
ast.literal_eval(df['cyberbullying_type'])
error
I was expecting to return back the string values as a list

ile and into Jupiter notebook and I get error UTF-8 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
NameError: name 'pd' is not defined
UTF-8 is the default encoding but can't decode some positions in this dataset.
Try this:
dataframe = pd.read_csv('File_name', encoding='latin')
Related information here: http://python-notes.curiousefficiency.org/en/latest/python3/text_file_processing.html

time data '2020-07-09T00:00:00+05:30' does not match format "yyyy-MM-dd'T'HH:mm:ssZ" [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am getting this error time data 2020-07-09T00:00:00+05:30 does not match format yyyy-MM-dd'T'HH:mm:ssZ please help
datetime.datetime.fromisoformat('2020-07-09T00:00:00+05:30')

reg ex for searching filenames [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I want to select the files, whose names ends with _90.jpeg|_180.jpeg|_270.jpeg|_90.jpg|_180.jpg|_270.jpg.
currently I am using the following approach
pattern = re.compile('_90.jpeg|_180.jpeg|_270.jpeg|_90.jpg|_180.jpg|_270.jpg')
pattern.search(filename)
Is there any cleaner way to represent the _xxx.yyyy in regular expression.
You can use:
pattern = re.compile('(_9|_18|_27)0\.jpe?g$')
If any digits are fine:
pattern = re.compile('_\d+\.jpe?g$')

Error 2 the system cannot find ... [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I can't delete the file using os.remove because some problem with the path.
here is the source code: http://www.filedropper.com/install_5
or : http://pastebin.com/L0na3XPm
i would be happy if someone can help me , thank you all
love
I see the line:
rmv=dst+"\\insatll.py"
Is this supposed to be "\\install.py" ?

Categories

Resources