Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23131 articles
Browse latest View live
↧

I keep getting TensorFlow ValueError and I dont know what is causing it

So i installed everything to run a jupyter notebook in Visual studio code and have tensorflow and python fully updated. However, I keep running into an error when I run one of the Kernels....

View Article


Calls to external API work when running code as a script, but receive `500...

I have an application to predict the size of a fish in an image. I have built a FastAPI endpoint --/predict/-- that runs the multi-step process to make that prediction. The steps include two calls to...

View Article


Sorting a Python Dictionary by "Date" keeping the integrity of the dictionary...

Upon doing some research online there does not seem to by any simple way to just order a dictionaryMy Dict contains a list with each name being the keydummy_data = {"Date":["01/24/2029","10/28/2027",...

View Article

Can Pandas GroupBy split into just 2 bins?

Imagine I have this table:Col-1 | Col-2A | 2A | 3B | 1B | 4C | 7Groupby on Col-1 with a sum aggregation on Col-2 will sum A to 5, B to 5, and C to 7.What I want to know is if there is a baked in...

View Article

How can I manually group features with the SHAP package?

I would like to apply SHAP to calculate feature importance for an RNN model that predicts an output variable y [N_instances x 1] from a feature matrix [N_instances x N_times x N_features]. As a...

View Article


Python DataFrame - Rolling count/tally between a list of values in a creative...

I am working on a project, and have chosen to try to learn some DataFrame because I am new to it.I have an interesting problem that you people may be able to help me with, as the DataFrame seems fairly...

View Article

What is "Verbose_name" and "Ordering" in class Meta? And please explain a...

from django.db import modelsimport uuidclass Book(models.Model): name=models.CharField(max_length=100) isbn=models.UUIDField(default=uuid.uuid4, primary_key=True)...

View Article

CodingBat Python make_chocolate code failing in "other tests"

There is a coding problem on CodingBat.com (Logic-2 Python section) that asks for a function to determine how many small chocolate bars are used for a weight requirement. The question is as follows:We...

View Article


Activating a pyenv virtual environment with direnv

I use both direnv and pyenv and would like to add something to my .envrc so that whenever I change directory, I also activate my virtual environment with pyenv.I printed environment variables both when...

View Article


TypeError: list indices must be integers or slices, not str. Using record_path

I've recently encountered a problem and can't seem to solve it. In my project I need to set the index of my pandas dataframe to a variable found in a Json file. The JSON file i'm using looks like...

View Article

can't use gekko equation

i want to define an equation in gekko, but than comes the error:Traceback (most recent call last): File "/Users/stefantomaschko/Desktop/Bundeswettbewerb...

View Article

How to read and write INI file with Python3?

I need to read, write and create an INI file with Python3.FILE.INIdefault_path = "/path/name/"default_file = "file.txt"Python File:# Read file and and create if it not existsconfig = iniFile(...

View Article

Not allowed to access Non IPM folder

I've been using exchangelib library in python for a long time now to access emails in an email account. It's been working amazing. Out of the blue today, I get an error saying,KeyError: 'folders'During...

View Article


Discord.py app_commands.guilds doesn't work as expected

class PrivateCogs(commands.Cog, name="PrivateFuncs"): def __init__(self, bot: commands.Bot): super().__init__() self.bot = bot self.logger = logging.getLogger('discord')...

View Article

MongoDB - How to delete documents which included in a list

I want to delete documents from a collection which are not included in a list with Python.All documents have a title field, and I have a list of the titles.The list of titles is like below:titles =...

View Article


ValueError: Exceeds the limit (4300) for integer string conversion

>>> import sys>>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.>>> _ = int('2' * 5432)Traceback (most recent call last):...ValueError: Exceeds the...

View Article

Image may be NSFW.
Clik here to view.

How can i parse GT06N Protocol Data from HEX to Text

i have been working on receiving data from a GPS tracker using the GT06N Protocol and i have managed to successfully receive the packets but now my problem is extracting the data out from the packets,...

View Article


Error encountered while generating bifurcation diagram

Bifurcation diagram error>Hello. I am currently studying the paper "(Nonlinear dynamics in the Cournot duopolygame with heterogeneous players)" by (H.N. Agiza, A.A. Elsadany) and trying to implement...

View Article

Plotting a hysteresis curve

I need to plot a hysteresis curve with given values of B and H, but, obviously it won't and definitely shouldn't give a nice straight line. My question is, considering my very beginner skills in...

View Article

Working Around Concurrency Limits in AWS Glue

I have a question around how best to manage concurrent job instances in AWS glue.I have a job defined like so:job = client.create_job( Name='JOB_NAME', Role='the-role-name',...

View Article
Browsing all 23131 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>