my problem is the following: The web page indicated in the script has a button (“Ver todo 50”) that displays the rest of the records of a table. I effectively click on the button with Selenium, but I can’t get the 50 records of the table but only the first 15 that the page initially displays…
PANDAS & glob – Excel file format cannot be determined, you must specify an engine manually
I am not sure why I am getting this error although sometimes my code works fine! Excel file format cannot be determined, you must specify an engine manually. Here below is my code with steps: 1- list of columns of customers Id: 2- The code to find all xlsx files in a folder and read them: I added the engine
psycopg2.errors.UndefinedColumn: column
I’m getting this error message when trying to fetch all the data Code Answer Did you really think that was going to work? SQL doesn’t know anything about your Python variables. Fortunately, with f-strings it’s an easy fix:
How can I define name ‘unit’ in def to?
I am trying to create a temperature conversion module. My class is set up as below: I then try to convert using the following: The original prints work but the conversion has the error: NameError: name ‘unit’ is not defined. How can I avoid this? Answer
how to extract 1st page after converting a pdf file to an image with subprocess.Popen
I’m trying to convert pdf files to images, and I’m doing it with subprocess. Now I need a way to extract only the first page without having to convert all of the images. In this case, for example, I only need to convert “out-1.png.” What exactly do I need to get this done? Here’s…
Python extract number between two special character in dataframe
I try to extract the number between the $ and white space in a column, then use the number to create a new column I look at many solutions on stackoverflow about Regular expression. it’s hard to understand my code doesn’t work are there any other solutions besides RegEx, if not, how to fix my code…
CPU only pytorch is crashing with error AssertionError: Torch not compiled with CUDA enabled
I’m trying to run the code from this repository and I need to use Pytorch 1.4.0. I’ve installed the CPU only version of pytorch with pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html. I ran the program by doing py -m train_Kfold_CV –dev…
How to access dictionary values
I am trying to print dictionaries keys and values separately, the dictionary that’ve created consist of 2 values in a list: {‘item’:[val1,val2]} How can i access the values separately? This is my code where i tried to access the value of val1, but am getting both of val1 & val2 Answer Th…
Using a for-loop and range function vs a while-loop
I’m looking for a function like range except that the step is a fraction of the previous number generated. So if the fraction was 99/100 the set of numbers might be something like this: 100, 99, 98.01… 0.001 Would this be more efficiently done with a for-loop and range-like function or with just a…
Replace text between two DataFrames in Pandas
I’m trying to replace/ablate terms within DataFrame if they appear within another DataFrame. For example, below is the replace DataFrame that includes an ablate column and a replace column. I’m looking to replace any word that appears within the ablate row with whatever is in the replace row. For …