Skip to content

Tag: list

Reordering a list based on another list in Python

I have two lists Ii0 and Iv0 containing numpy arrays. I am using argsort() to reorder elements in Ii0 to generate a new list Ii01. I want to use the same order to reorder elements in Iv0 to generate a new list Iv01. I present the current and expected output. The current output is The expected output is Answer…

Python Regex for Searching pattern in text file

Tags in Sample.txt: <ServiceRQ>want everything between…</ServiceRQ> <ServiceRQ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance>want everything between</ServiceRQ> .. Please can someone help me to get the regex? To extract the expected output from a text file. I want to…

Subtract specific value from a list (of numbers) by user input

I’m a begginer in Python and i’m trying to do a program when the user chooses a number from a list, then after you type by how you much want to reduce this chosed number and then print the list. I know that using list[specific index], check if matches with user input and repeating over and over ag…