Category "python"

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

Stuck on "Installing build dependencies ... \" while installing scikit-lean on jupyter notebook

I get stuck when i use pip install to install scikit-learn on jupyter notebook I tried to find other solution that I found on internet but it is always the sam

What to do when pip dependency resolver wants to use conflicting django plotly dash versions of a application?

So I'm trying to integrate plotly with my django app however I'm having an issue rendering a chart. I was using VSCode which did not pick up the dependency conf

How to Show a Picture in Qt python

How Can I Show A Picture in PyQT6? My Code: from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.

how to run a kivy app on ASUS tinker board?

I am trying to run a kivy app (basic to print hello world) on asus tinker board and i am facing this error. I am new to the kivy app development as well as new

Issues with word2vec

I'm wondering why this program only creates a py plot of letters rather than words. Am I giving it the wrong kind of data for word2vec? The program runs just fi