How to adjust Selenium/Python code for data extraction using different...
I am new to web-scraping and am trying to get bus prices from different Canadian bus companies.I wrote some code with the help of fellow StackOverflow members to get price data from...
View ArticleDouble printing in PyCharm
I installed PyCharm a few days ago, and it worked fine, but for some reason, when I code something now, it prints it twice.For example, for the code:n = 4if n == 1: print(n, "is 1")elif n == 2:...
View ArticleHow do I pass through the click on a GtkEditableLabel to the GtkColumnView...
I have a Gtk.ColumnView where cells are represented by Gtk.EditableLabels. Keyboard navigation works fine, clicking in the cells to edit them works fine, tab navigationworks fine.However, clicking...
View ArticleTensorflow lite sample code does not work from the tutorials
https://ai.google.dev/edge/litert/models/signatures#javaI have the model generated, I have the model loaded. I verified this because I can see the signatures that are available:I don't know what the...
View ArticleIs there a function to filter a dataframe by a column value and produce a...
In python pandas, I'm wondering if there is a builtin function that does the same as df_to_dict below. Speed is of the essence, as my dataframe can have thousands of rows. Basically return a dictionary...
View ArticleWhat is the algorithm behind np.linalg.solve?
I am supposed to compare the efficiency between different methods to solve a system of linear equations in python. One of the methods I used was np.linalg.solve.I have been trying to find the algorithm...
View ArticleResample intraday pandas DataFrame without add new days
I want to downsample some intraday data without adding in new daysdf.resample('30Min')Will add weekends etc which is undesirable. Is there anyway around this?
View ArticleRead from PDF and copy to Excel cells exactly as formatted
I'm using Python with pdfplumber to read a PDF file and copy its contents into an Excel spreadsheet. It works fine, but I want to preserve the formatting and indentation as well as remove extraneous...
View ArticleElement cant be found in any ways inside Menu
I'm trying to do QA Autotest on Google page menu in the top right corner. Učet = Account button.When I try to doelements = self.driver.find_elements(By.CLASS_NAME, "j1ei8c")elements[0].click()It acts...
View ArticlePascal's Triangle with a List
My assignment is make pascals triangle using a list.I will receive the users input which is the height of the triangle and go from there.I have a psuedo code, but I just don't know how to implement the...
View ArticlePython Lambda to send files uploaded to s3 as email attachments
We have an online form that gives people the option to upload multiple files. The form is built by a third party, so I don't have any involvement with them. When someone uploads files using the form it...
View ArticleDrop column by index in polars
I need to drop the first column in a polars DataFrame.I looked here and it suggests:result = df.select([col for idx, col in enumerate(df.columns) if idx != 1])It looks long and clumsy for such a simple...
View ArticleHow do I use multiple filters in the Google Analytics 4 API from Python?
I am using the Google Analytics 4 Data API with the Python client library to run reports. I'm able to run a report with a single FilterExpression to filter traffic where the country equals "United...
View Articlepython request getting different result than postman
I am attempting to improve my python by working on a side-project, just interacting with websites to look at avaialble golf tee times. Zero intention/plans to do anything commercial, this is just a...
View ArticleGet last non-zero index in a vector (NumPy)
I have a 1D NumPy array, and I want to find the index of the last non-zero element. The vector consists only of 1s and 0s, not sure if this is relevant information.For example:import numpy as npvec =...
View Articlehow to convert the llama4scout to tensorrt-llm checkpoints to server with the...
i am trying to get the checkpoints for the llama4scout-scout-17B-16E model i am constantly getting the following error.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File...
View ArticleAttributeError: 'AsyncSniffer' object has no attribute 'stop_cb'
When running the following code:import timefrom scapy.all import AsyncSniffersniffy = AsyncSniffer(iface="wlp0s20f3", filter="not arpand not port 22")sniffy.start()time.sleep(1)sniffy.stop()I get: def...
View ArticleIs there a performance benefit in polars in regards to parallelism using...
Is there a difference in regards to parallelism in polars when comparing these two methods which gives the same result? Method 1 assigns in select as an intermediate step which shows that x_1 and x_2...
View ArticleSending packets with Scapy within Python environment
I am playing around with Scapy and I want to use it within a Python script but sending packets seem to be a problem. Here is my code.Scapy...
View ArticleGetting "Container not found" error when trying to modify GridDB container...
I need to add columns to an existing GridDB container in my Python application, but getting a "Container not found" error when trying to modify the ColumnInfo after container creation.import...
View ArticleType hint two function parameters to constrain them both to the same type and...
I would like to annotate both parameters of a function – supposed to perform simple comparison between them – in order to indicate that their types should be be the same and should support simple...
View ArticleSikuli: for loop/if else statement not working correctly
I have the following code in Sikuli that does copy and paste tasks. I want it to execute the actions inside "if not exists" when caption.png does not exist, but sometimes even if it doesn't, it is...
View ArticleHow does NumPy initialize its random seed? [duplicate]
When I use multiprocessing to create some processes, it seems that processes have the same state. How does it work?I want each process has a different state, so that the data created by numpy.random is...
View ArticleCan't put table name into SQLAlchemy Query in Python [duplicate]
In python I am connected to a SQL server through using an engine, and I have manipulated the SQL data in workbench. I now want to move that data manipulation into python. The names of the tables I will...
View Articlemysql python copying columns [closed]
I have found similar questions, but none that cover my exact situation.I have a table (lets call it A), one of the columns is composed of integers. I want to update this column, from a different table...
View ArticleErrors with MLP neural network made from scratch trained on MNIST dataset
I'm experimenting with neural networks and decided to create an MLP from scratch to classify digits based on the MNIST training dataset. The MNIST data set I'm using is in the csv format and downloaded...
View ArticleFlask SQL model missing one positional argument
from flask import (Flask, render_template)from flask_sqlalchemy import SQLAlchemyapp = Flask(__name__)app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://user:password@localhost/database'db =...
View ArticleConstraints: AddNoOverlap with OnlyEnforceIf
I have set of tasks in a constraint satisfaction problem. These tasks are using a centrifuge. So if they overlap, then they must overlap completely (I can't add tasks while the centrifuge is...
View Articleface_recognition module not found
RESOLVED - Installed on earlier version of Python, 3.10.7, without any issues.Need help in using the face_recognition library. On Windows 11, I am using Python 3.13.3. I am repeatedly getting the...
View ArticleBabel numbers format_currency function
I am working on a site where we use many languages and in order to display the price/currency accordingly we make use of babel library. The issue is when calling the format_currency it returns always...
View Article