Category "python"

how do i fix "ERR_SSL_PROTOCOL_ERROR"?

i made a server with twisted python like below options = ssl.CertificateOptions(privateKey=cert.privateKey.original, certificate=cert.origin

Fix wait time for Selenium Form using Python

I'm new to Python and am trying to automate a form fill up. I have done all the work but when trying to "Submit" it's not reading the XPATH and hence not clicki

How to get TF-IDF value of a word from all set of documents?

I need a TF-IDF value for a word that is found in number of documents and not only a single document or a specific document. For example, Consider this corpus c

Convert date format from a 'yfinance' download

I have a yfinance download that is working fine, but I want the Date column to be in YYYY/MM/DD format when I write to disk. The Date column is the Index, so I

CSV adding values to an existing column and calling from a dictionary (no pandas)

I need to add some additional values to an existing column for my CSV file. So this is what I have so far: Sample input CSV file: Alfa,Beta,Charlie,Delta,Echo,F

Training loss much lower than test loss even though it's using the same data

I'm using the same data for training and testing (which isn't best practice), and in theory the loss should be exactly the same. However, when training, my loss

Retrieveing floor price for specific filtered assets Opensea

I know how to get normal collection floor price. However I'm trying to find out how to retrieve floor price for specific filtered assets. such as, grabbing floo

How to maintain Audit Logs

I am storing user data in MongoDB and want to maintain activity logs for each user. eg: Who logged in and when? Which user perform certain and when they did Al

strip all strings in list of specific character

I have been looking for an answer to this for a while but keep finding answers about stripping a specific string from a list. Let's say this is my list of strin

Add missing dates to pandas dataframe

My data can have multiple events on a given date or NO events on a date. I take these events, get a count by date and plot them. However, when I plot them, my

How to write an unit test in Python in tictactoe code

--------- Global Variables ----------- # Will hold our game board data board = ["-", "-", "-", "-", "-", "-", "-", "-", "-"] # Lets us know

3D head mesh morphing from one mesh into another using scripts (C, C++, python etc) [closed]

I have 2 3D head images and want to morph one into the other (animation) without using blender, three.js etc. I want to do it using coding pre

Read data from text file given in a Tree format

I am trying to read the data from a text file given in a tree format. A sample of the text file looks like this, ['972651', '80080680482123777', '0.0']->['10

How to use the JSON response from a Python App, To render it with Javascript on to an HTML page using Fast API? [duplicate]

I have an HTML page being rendered with FastAPI: @app.get("/index", response_class=HTMLResponse) def write_home(request: Request): return t

Determine butterfly subtopologies in a network topology

I recently got a project where I have to identify all the butterfly subtopologies in a network. The network has to be implemented using a graph. Fortunately, I

RLE ALgorithm in python

like the title suggest I want to do an RLE algorithm and I have few problems with that for example in RLE algorithm if we take aaaabbbccd it should return a4b3c

Find a pattern in middle of multiple sentences

I have a dataframe as below, data = [ [ 1, 'AR-123456' ], [ 1, '123456' ], [ 2, '345678' ], [ 3,'Application-12345678901'], [ 3, '1234567890

Trying to find a graph in matplotlib

I have data that show the difference of temperatures from 1955 to 2020 from an average. I want to make a graph in matplotlib that looks like this: It shows tem

Python TCP Game Server

So I am making a multiplayer CCG (collectable card game) in Unity (client side). I have chosen Python as the programming language of the server since I feel rea

Python with matplotlib and tkinter is working but I don’t understand how

I’m writing a program to help me solve small puzzles, like Sudoku. I’m a newbie at Python and am just starting to use matplotlib and tkinter. I&rsqu