Category "python"

how can i implement or convert a python code to javascript to be used with tensorflow js

how could I use this code in python with tensorflow js? it is to occupy it with a model that was trained with the dataset tf.keras.applications.ResNet152(input_

Flask sqlalchemy: how to draw two foreign key relationships to the same table

How would I go about creating the foreign key relationships for a very simple friend request database schema in flask sqlalchemy. Both the requester and request

How to optimise function logic to avoid duplication - python

I have some code below, for a given name that matches pattern with 2 lower case letters (such as 'aa'), the valid name can be V-aa or X-aa def verify_helper(val

how to get the caller's filename, method name in python

for example, a.boo method calls b.foo method. In b.foo method, how can I get a's file name (I don't want to pass __file__ to b.foo method)...

How to get(extract) year, month or day from datetime.datetime(2021, 1, 25, 21, 20, 46) format? Python

could you please advice on this one? How to get(extract) year, month or day from datetime.datetime(2021, 1, 25, 21, 20, 46) format? For ex from the date (2021,

How To Access Repository Secret

I've made a repository on GitHub and have added a Repository secret. However, I can't seem to grab the secret's value. Any help would be greatly appreciated!

Django Image upload issue Cloundinary

I'm learning Django at present and just about getting to the deployment stage at hit a problem serving static/media with Cloudinary, following guides how to do

Grab the first entry from json [duplicate]

I apologize ahead im really bad at explaining things. I have a variable with json data in it, the first entry in this json data will change bu

Proper use of pool.map

I have an asynchronous function that checks if the token is valid. I want to count how many working and non-working tokens. Also I use aiomultiprocess. The code

Cannot import name 'get' from partially initialized module 'requests'

I have problem with requests package. In past requests was working, but today for no reason it stopped working. I am just importing requests and it cause error.

how to get the caller's filename, method name in python

for example, a.boo method calls b.foo method. In b.foo method, how can I get a's file name (I don't want to pass __file__ to b.foo method)...

Is there any way to print the pytest parameter names

Whenever pytest is outputting the tests that it has, it always prints out the parameter values, but never the names of the variables. For example: PASSED test_c

Grab the first entry from json [duplicate]

I apologize ahead im really bad at explaining things. I have a variable with json data in it, the first entry in this json data will change bu

Proper use of pool.map

I have an asynchronous function that checks if the token is valid. I want to count how many working and non-working tokens. Also I use aiomultiprocess. The code

ModuleNotFoundError - Installing PyCharm and Anaconda [duplicate]

I'm setting up PyCharm and Anaconda on a new computer and am running into errors saying modules are not found. I've confirmed that the module,

Problems installing the python library for salvus

I'm having some problems installing the Python library for salvus (see installation instructions). When I use Conda to configure the salvus environment, the fin

How can I use Gaussian Mixture to fit 2 gaussians in my data?

I'm trying to fit 2 gaussians in my red/blue population data. But it does not fit. What am I doing wrong? The code is: mag1 = 'z' mag2 = 'y' mask_rich = (wazp_m

I have this error which says that there is no "wrapper" in the module curses

import curses import os from curses import wrapper # import Wrapper as Wp def design(stdscr): try: curses.init_pair(1, curses.COLOR_RED, curses.CO

I created a file and stored some value there. When i opened the file in read mode and printed read(33) and printed tell() its showing as in below:

[enter image description here][1] I created a file poem.txt a stored a poem: There is freedom waiting for you, On the breezes of the sky, And you ask,"What if i

Newbie Glade user confounded by radio buttons

I have a Glade GTK Gui which is meant to be a Front End for a CLI program I wrote a couple of years ago. There are a number of fields for the user to fill in. T