I’m getting a UnicodeEncodeError when I run the code below. It simply loops until i = 9000, appends an html entity to a list based upon the value of i, then writes the list to a file after looping. Doe’s anyone know where I’m going wrong? Answer By default this open method doesn’t supp…
Getting error on discord bot discord.py for typing in role
I get this error on my bot when mentioning a role,here is the error, raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unhashable type: ‘set’ my code: What’s meant to happen: Me:-war Bot:Are you sure Me:reacts Bot:T…
How can I move the legend from the plot to the appropriate place? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question member…
Matplotlib flattens the first of two plots when I add the second plot?
Matplotlib madness… However, when I try to run a cumulative plot of any kind, MPL flattens the first plot and plots the second relative to it: I’m doing stock analysis, and trying to plot returns relative to the existing closing price. I don’t understand why MPL is flatting the first plot &#…
IndexError: Target 1 is out of bounds
When I run the program below, it gives me an error. The problem seems to be in the loss function but I can’t find it. I have read the Pytorch Documentation for nn.CrossEntropyLoss but still can’t find the problem. Image size is (1 x 256 x 256), Batch size is 1 I am new to PyTorch, thanks. Error: A…
Python discord bot using discord.py problem
I’m trying to make a discord bot using the module discord.py, but I’m running into an issue and I’m unable to fix it. What I’m trying to do is that when someone pings the bot, he answers his prefix, I got that working with : However none of the code after that works: , so I cannot use …
How to use colormap in subplots?
For a project, I’m trying to plot on the same figure (using subplots) to “graph”. The data have been collected using a database (but for my problem here, I tried to selected only reasonable number of value). On the left of the figure, I plot the temperature in JFK during 10 consecutive days …
how should i scrape href links from this website?
I’m trying to get every products individual URL link from this link https://www.goodricketea.com/product/darjeeling-tea .How should I do that with beautifulsoup? Is there anyone who can help me? Answer To get product links from this site, you can for example do: Prints:
Python Import Excel List
I have the following list in Python: I now want to save these into an Excel and then read them in. How can I do this? I have not found such a “simple” import with Google, mostly it is more complex imports of Excel files. Thanks Serpiente32 Answer Here is a sample code: Output: Note: You should nev…
Trying to import a script from other code
I need help to import a script, i did 2 codes, the first is a test with some prints and in the second i try to import them: Code 1 Code 2 But in code 2, when i did os.system(r”python C:UsersGabriPycharmProjectspythonProjectImagens.py”) nothing happen. Someone can help me to import this code? ;-; 1…