I am trying to click on the rate button to set the rating for episode one of Atlanta season four on the IMDB website as illustrated by the image further below. I have tried various combinations of selenium xpath values and have googled various links to attempt to achieve this, but can’t remember which n…
Tag: python
Python create lists conditionally from txt file
I have a txt file with this structure of data: 3 100 name1 200 name2 50 name3 2 1000 name1 2000 name2 0 The input contains several sets. Each set starts with a row containing one natural number N, the number of bids, 1 ≤ N ≤ 100. Next, there are N rows containing the player’s price and his name
Error in running a project regarding virtual environment and “DJANGO_SECRET_KEY” in VS code
I want to run a project from gitlab on my local machine. I cloned the project, created a virtual environment and activated it. When I want to run without debugging I got this error: The output of this project is a form, how can I solve this error to get the output? Answer There’s a good explanation here…
Python and FastAPI: keep getting 405 when posting response
I have made at fasstapi at https://lectio-fastapi.herokuapp.com/docs#/ When I test on the fastapi site it works like a charm. But when I try to access it from another python program i get 405 when posting the output I am getting is: And I am expecting to get these returns: It seems like to me I need to define…
UTF-8 characters in python string even after decoding from UTF-8?
I’m working on converting portions of XHTML to JSON objects. I finally got everything in JSON form, but some UTF-8 character codes are being printed. Example: This should be: This is just one example of UTF-8 codes coming through. How can I got through the string and replace every instance of a UTF-8 co…
Python equality statement of the form a==b in [c,d,e]
I just came across some python code with the following statement: It turns out that: Am I right in assuming that a==b in [c,d,e] is equivalent to (a==b) in [c,d,e] and therefore only really makes sense if [c,d,e] is a list of True/False values? And in the case of the code I saw b is always in the list [c,d,e]…
iterrows() , if statement and assigning string to new column
I want to add some data to a dataframe to analyse stock price movements. I want to check, if a row is the narrowst range in 7 bars. Unfortunately I seem to be able to run through the df array and perform a basic check. But I can´t assign a string to a column when the If-Statement fulfilled.Any ideas what´s
How can we make a prediction using Scikit-Learn Classifiers?
I can easily train and test a classifier using the code below. Now, how can I make a prediction of the target variable (dependent variable) based on the independent variables? Something like this should work, I think, but it doesn’t… If we leave numerics as numerics, and put quotes around labels, …
python: convert parenthesis to bracket
I need to check if longitude, latitude is in polygon in Python 3. The code below works, but I have a problem putting data from variable. but my data are like this (I get data from json file with json.load) How can I pass data from coordinates[0] to polygon which requires ( ) instead of [ ] and this doesn̵…
How to parse a string in argparser during execution
I want to create a mini shell, so after i run my file, With whatever arguments I add, I then just constantly take input like a normal shell, So I am just doing simple while True: command = input(), but these commands may take flags as well so stuff like However I can’t really parse these the same way as