How to filter users that had an event between two other events in pandas?
I have a table that looks like the following:user_ideventtimestamp1launch2023-09-15 14:31:441buy2023-09-15 14:31:491cancel2023-09-15 14:31:501add2023-09-15 14:31:522add2023-09-16...
View ArticlePython using endswith method issue with remove from list [duplicate]
This is my code:domains = ['google.com', 'yahoo.co', 'bing.msn', 'biz.info', 'you.biz', 'test.store', 'myblog.blog', 'finally.xyz']extensions = ['.blog', '.co', '.com', '.store', '.xyz']Finally, I'm...
View Articlefunction on Django to check user in database
I want to write a function to check a user in the database, can anyone help?can someone help i am learning DjangoI try many ways but ...------------view.py----------------def user_enter(request):...
View ArticlePython Mapping Data and Appending to Excel
I'm working on a project where I need to process data from an Excel file and organize it based on a predefined directory structure. However, I've encountered some issues with my code, and I could use...
View ArticleHow can I adjust the Nix Flake configuration for my virtual environment to...
I want to create a virtual environment where I can run this c.py using ollama. (like in this example https://python.langchain.com/docs/integrations/llms/ollama)c.py:from langchain_community.llms import...
View ArticleHow to release Python memory back to the OS
I have a long running Python script that takes 1-2 hours to complete. It's running on a 4gb container with 1 CPU.The script fetches and processes data in a for loop. Something like the following:for i...
View ArticleGenerate triangular matrix of cumulative products efficiently
Take a 1D vector, for example [a b c d].Then build the following matrixa 0 0 0ab b 0 0abc bc c 0abcd bcd cd dThe code I got so far does the job, but it's ugly and has a for loop which should be...
View Articlepython ip via urlwith socket I have request
vorrei sapere come prendere l ip private tramite url con python socketmi aspetto uin buon colloquio
View ArticleCan Javascript DataTables show raw/literal strings instead of interpretting...
I've built a Flask app that displays text data from CSV files uploaded by the user in a DataTable. Occasionally a text might include escape characters or even a bit of code/tags. I want all text to...
View ArticleMy webcam is not showing using Tkinter in a while loop
i have this problem where my webcam is not showing using Tkinter,i want to make a GUI where the person click the webcam button and start detecting sign languague, works only when the function...
View Articleiterate over 10 k pages & fetch data, parse: European Volunteering-Services:...
I am looking for a public list of Volunteering - Services in Europe: I don't need full addresses - but the name and the website. I think of data ...XML, CSV ... with these fields: name, country - and...
View ArticlePersistence diagram feels wrong...?
This is an image of my python plotly diagram, I feel like it looks wrong but somebody ensured that based on a chart this is technically correctly plotted?In a sense, this is based off the Nasdaq chart...
View ArticleHow can I define multiple combinations of Non Linear Constraints using SciPy?
I am trying to solve a minimisation problem using the SciPy Differential Evolution algorithm. The function to minimise is: f(a, b, c) = a*sin(c*sin(b)). But the problem is not that simple: the...
View ArticleWrap a pre-trained pytorch model into torch.nn.Module class
I want to learn how to convert pytorch model into TorchScript. To do that I have to define a torch.nn.Module class that wraps the model first.I use HuggingFace Diffusers or Transformers class to wrap...
View ArticleHow to prevent xlwings from disabling other add-ins (SQL Spreads)
I have the SQL Spreads add-on for work unrelated to this code.When I attempt to run my xlwings python script, it always crashes when attempting to open an excel workbook:wb_output =...
View ArticleUsing AWS Secrets Manager with Python (Lambda Console)
I am attempting to use Secrets Manager a Lambda function in AWS. Secrets a manager is used to store database credentials to Snowflake (username, password).I managed to set up a secret in Secrets...
View ArticleWhy does it show IndexError: string index out of range?
list = (input('Enter your list(number only) : '))def scorefunction(score): length = int(len(list)) maxs = length + 1 test = 0 n = 0 while test < maxs: if list[n+1]<list[n]: scorefinal = score n =...
View ArticleHow to retrieve source documents via LangChain's get_relevant_documents...
I am making a chatbot which accesses an external knowledge base docs. I want to get the relevant documents the bot accessed for its answer, but this shouldn't be the case when the user input is...
View ArticleIs there a way to bind a Function to a Tabview change in CustomTkinter?
I was making a desktop application using customktinter library, and in that application i have used CTkTabview to make different tab for different functionality and i wanted a funtion to be fire when...
View ArticleProblem playing video playlist in tkinter
i making a program that plays a video when it matches with a word that a person says, if it matches, the video shows in a tkinter label.My problem is when it matches more than one word, because the...
View Article