im trying to set correct version on output. I have this possible strings: 0.0.4.1 # 1. 7.51.4.1 # 2. 0.1.4.1 # 3. and i need to check, if the “0.” is on the start (to set output without 0. or 0.0.) Output 1. will have just “4.1”, 2. gonna stay the same and 3. will be 1.4.1 Im trying to
Tag: python-3.x
Wrong result with regular expressions
Any idea why the regular expression below cuts the ‘fl’ part of the sentence ? This is the result I get : Answer You’re replacing all non-alphabetical characters with whitespace. In your code, the ‘fl’ is actually fl – a single unicode (non-AZ) character, so it is being removed, along with the punctuation.
Unable to send WhatsApp message using chrome driver Python Error: NoSuchElementException
This is my first post here! I am using Selenium’s Chrome Driver to send WhatsApp attachment to some people. Here is my code: ERROR: It says it is unable to locate the element but I have bene very careful in inspecting the website and then writing the code. Still I wonder why it does not work. Can anyone please help
Python – Trying to print each line that has a string value that matches the index provided
Now I’m still pretty new to python and programming in general, but I know I’ve gone a bit of a roundabout way this entire program. But here is what I have and what I want if anyone can help. Begins by reading a text file e.g. ADF101,Lecture,Monday,08:00,10:00,Jenolan,J10112,Joe Blo ADF101,Tutorial,Thursday,10:00,11:00,Jenolan,J10115,Cat Blue ALM204,Lecture,Monday,09:00,11:00,Tarana,T05201,Kim Toll Then I make empty lists and append them
Match two dataframes and fill the column value in pandas
I have two excel file. I have to match them based on particular column and fill the other column. I explain you in the example. Example: 2 excel files: monitered call.xlsx In this excel 2 sheets are there, 1. print add 2. digital digital C2D.xlsx single sheet is there Sheet1 monitered calls.xlsx: digital C2D.xlsx I have to match Caller Number
When I try to install the paramiko module in Python 3.5.1, I get an invalid syntax and cannot install it
When I tried to add a module called paramiko to Python 3.5.1 to add ssh communication functionality at the command prompt, I got the following error message and could not install it. For the installation method, I entered the following I hope you can help me with this problem, thank you. Answer As shown in the error message, the string
python convert timedelta to meaningful string such as “1 hours”
I want to convert a python timedelta object to an easy to read meaningful string for example: any ideas how to do that? Thanks Answer Actually timedelta class, provides you days, seconds, microseconds property directly. But in order to get “hours” and “minutes” you can do some simple calculations yourself. Divide seconds by 60 to get minutes, by 3600 to
Print values of an array as x coordinates and y coordinates seperately – IndexError: list index out of range
I am trying to plot values of x coordinates and y coordinates of image array seperately step1: 2 image arrays are given of size (10,2) step2: find matching coordinates if they are same or distance between them is lessthan 3 step3: print x coordinates and y coordinates of image1 & image 2 My code: expected output: xcoordinates now: IndexError: list
How to create n-dimensional sparse tensor? (pytorch)
I want to initialize tensor to sparse tensor. When tensor’s dimensional is 2, I can use torch.nn.init.sparse(tensor, sparsity=0.1) Result But when tensor dimensions > 2, this function isn’t work. Result I need this because I want to use it to initialize the convolution weights. torch.nn.init.sparse_() function’s def is below How could I make n-dimensional sparse tensor? Is there a way
How to reference widgets inside widgets using IDs in Kivy, Kivy Lang, Kivy MD
okay, THIS HAS BEEN DRIVING ME INSANE FOR LIKE THE PAST TWO DAYS. and its really annoying, so i am building an application using kivy, after getting used “easy as pie” tkinter I thought it was time to learn kivy (as it has mobile compatibility). #I wanted to learn to reference different widgets# I searched YouTube and google for hours