Category "python"

out of memory error when reading file with json.loads in python

hi i create a file and fill it with below code: i have some lists which i fill them and write them in file. each list will be written in one line. import json

Getting the current selected tab name of ttk notebook in tkinter? - python

I'm creating a GUI that shows different plot types in different tabs, so I created this helping function and I'm trying to figure out how to get the current tab

Creating a summary statistics table in python

I am trying to recreate the 'SummarySE()' function from R in python but I am having trouble getting it to work. The function creates a summary stats table from

generate_tfrecord.py: error: unrecognized arguments - error while trying to create TF Record files for test and train data

While using the generate_tfrecord.py, I'm always getting this error of "generate_tfrecord.py: error: unrecognized arguments". But, I haven't changed anything, a

Using metamask to authenticate a SSO flow

Is it possible to do something like a social signup/login using crypto wallets like Metamask? Analogous to signup/login with Google/Facebook/Apple... Does the c

Mean spectra over multiple pixels from datacube

I have a fits datacube with galactic longitude, latitude and velocity in the 3 axis. To extract the spectrum from the datacube at a particular pixel value of lo

Minimum depth of a binary tree

I'm trying to write code to find the minimum depth of a binary tree. https://leetcode.com/problems/minimum-depth-of-binary-tree/ # Definition for a binary tree

jupyter contrib nbextension install gives Jupyter command `jupyter-contrib` not found

Trying to (re)install Jupyter's nbextension via the following steps in terminal pip install jupyter_contrib_nbextensions jupyter contrib nbextension install --u

PyAutoGui screenshots are black

Screenshots taken from PyAutoGui are black. import pyautogui pyautogui.screenshot('ss1.png') pag.screenshot('ss2.png', region=(0,0, 200, 100)) I'm using Fedor

WARNING: `pyenv init -` no longer sets PATH when starting the terminal window

Goal: I am trying to install the "pyenv" on my Linux machine with the help of this article "https://realpython.com/intro-to-pyenv/" Expected Result: according t

Error installing snowflake connector for python

When I try to download snowflake connector as following https://docs.snowflake.com/en/user-guide/python-connector.html I get an error for metadata-generation-fa

Unable to load facenet_keras.h5 model in python

I am fairly new to tensorflow and dont have any idea what is going wrong. It keeps me showing this "bad marshall error" which i cant seem to understand is cause

How to overwrite default value of parameter in python __init__ method from class with two levels of inheritance:

I need to overwrite the default parameter value of __init__ method of a class that is on a three-party model which inherits from another three-party module, but

Issue doing a GET with SNMPv3 using pySNMP in 3.7

I'm trying to learn how to use pySNMP and I'm trying to simply do a get using encryption with SNMPv3. Here's the code. iterator = getCmd( SnmpEngine(),

Background of image turning black when using keras.preprocessing.image load_img

my code: from keras.preprocessing.image import load_img, img_to_array from keras.preprocessing.image import smart_resize import numpy as np #load pretrained mo

Gunicorn worker terminated with signal 9

I am running a Flask application and hosting it on Kubernetes from a Docker container. Gunicorn is managing workers that reply to API requests. The following wa

Why ais my output "nan", keras model prediction

I'm trying to make an AI attempting to predict numbers from prime number sequence, but my model outputs "[[nan]]". My csv file is formatted like this: number of

drf - remove miliseconds from serializers.DateTimeField when sending response

I have to write a serializer that returns datetime in the following formats: 2012-01-01T13:00:00+00:00 (utc_with_timezone) 2020-01-01T09:00:00 (must be in local

Button element not interactable Selenium

I'm trying to write a script to automate some tasks with Selenium and Python, and every time I try to click on a button from selenium import webdriver from sele

interactive graph with export data to mysql or csv on wordpress

I want to create an interactive diagram on one of my WordPress subpages. Unfortunately, I am only proficient with Python, whereas my server does not support Pyt