Category "python"

Install requirements.txt uses a different path

Fellow users, I am trying to install a requirements.txt file (via cmd prompt: "pip install -r "path\to\file"). The problem is that my system returns an OSError

Regex to match Python docstrings

I would like to parse Python docstrings as follows: Summary of class that is multiple lines. Parameters ---------- param1 : str Param 1 is a param Returns

Filtering list of objects based on attribute

I have 4 objects. class MyObject: def __init__(self, id: int, result_name: str): self.id = id self.result = Result(result_name) class Resu

Python substring matching question and or logic [duplicate]

I am starting to learn Python and writing a small script with the following logic and can understand the reason for the output or the results

Using Regular Expression to narrow down dictionary based on Wordle rules

I am trying to do Wordle Solver as my resume project. I want to develop some word suggestions by narrowing down dictionary of words using RegEx. Is it possible

Dictionary making weird key:value pairs

I want to make a simple calculator, where you just type in something like "2+2*2" and it calculates the answer. First step was to find, and cut out the individu

"Task exception was never retrieved" error In discord.py

I am a beginner in python and am trying to make a bot in discord.py that has a command that has whoever runs the command explain how to use something. But I get

How to use sql NOT operator in sqlalchemy

I have a simple table with an int[] column and I would like to be able to select rows that do not contain a specified user. And I can't figure out how to do it

Selenium getting stuck when looping through pages

I have written code that pulls text from sites and analyses them for readability. However, I sometimes get stuck on sites. Is there any way for me to have my pr

how to open a text file after opening workbook in openpyxl Python

i have been trying to append some data on my excel sheet using openpyxl and after that append some data in my text file...for some reason it gives me error when

How to generate an equivalent of pandas.DataFrame.describe in bigquery SQL?

In Pandas, you can get an overview of the table (mean, quantiles, count and count of unique values) for all columns by using the following method: pandas.DataFr

How to combine two dataframes into one like this, using pandas and python?

Please see the picture here. I have two data frames and i need to convert it into single one, using merge or concat method and i am unable to do so. Can our com

Why does pyppeteer take such a long time to load a single webpage on AWS Lambda

I am currently trying to crawl MVN Repository using puppeteer on AWS Lambda. However, my test function would run for 15 minutes and proceed to fail after that (

Change an audio file frequency into ultra-sonic sound frequency

I'm trying to change my audio file frequency in Javascript and after a lot of struggle I came to one solution, files are given below but I face one limitation h

Check whether deployed in cloud

I have a python program running in a Docker container. My authentication method depends on whether the container is deployed in GCP or not. Ideally I'd have a f

Selenium getting stuck when looping through pages

I have written code that pulls text from sites and analyses them for readability. However, I sometimes get stuck on sites. Is there any way for me to have my pr

why this line of my code crash the archive?

This part of the code for some reason doesn't allow me to read anything from the file correctly. It's like I delete everything and leave white spaces or somethi

How to combine two dataframes into one like this, using pandas and python?

Please see the picture here. I have two data frames and i need to convert it into single one, using merge or concat method and i am unable to do so. Can our com

Regex for a extracting a string starting with a particular word and ending with a year

INPUT 1: The string is enclosed CASE NO.: Appeal (civil) 648 of 2007 in between. OUTPUT 1: Appeal (civil) 648 of 2007 INPUT 2: The string is enclosed CASE NO.:

why this line of my code crash the archive?

This part of the code for some reason doesn't allow me to read anything from the file correctly. It's like I delete everything and leave white spaces or somethi