Skip to content

Tag: python

How to fix website picture problem on HTML

Is there a problem with this code I tried reformatting the code, by replacing the products.url into the alt brackets. But it was what i typed on in the brackets that showed up. Answer I am not exactly sure what your problem is but I see problem in code, try replacing: to and then update this lines with new va…

How to Plot Implicit Equation in Python

I want to Plot V(y axis) vs t(x axis) graph using the below equation at 5 different values of L(shown below) L= [5,10,15,20,25] b=0.0032 Equation, (b*V*0.277*t) – (b*L) = log(1+b*V*0.277*t) code output will be as shown in figure Expected Outcome Answer While sympy exposes the plot_implicit function, the…

Need to find and replace/correct list from another df column

I have a list let suppose F = [Jonii, Max, anna, xyz, etc..] and df which contains 2 column- Name and Corrected_Name. df I need to search each string from list into df[Name] and replace it with df[Corrected_Name]. For eg. in above, code will search list in df[Name] and if found which is “Jonii” th…

Infinite looping Issue Python. Can’t quit game

I made a code for Blackjack in Python and whenever I run blackjack_game(deck) saying no to the ‘Play Again’ input should quit the game but it doesn’t. Funds going zero and below should also trigger the game to quit but it doesn’t. This is what it looks like: I added a quit() that shoul…

Iterate over inner axes of an array

I want to iterate over some inner dimensions of an array without knowing in advance how many dimensions to iterate over. Furthermore I only know that the last two dimensions should not be iterated over. For example assume the array has dimension 5 and shape (i,j,k,l,m) and I want to iterate over the second an…

Pandas: replacing nan values conditionally within a group

I have a dataframe with missing values. for each index in a column group, i want to replace these values seperately. If all of the values in a group are missing, i want to replace the values with 1. If only some of the values are missing, i want to replace it with data from an imputed dataframe dataframe 1

Secrets pip not downloading MacOS

the secrets library is not downloading when I try to install the pip. My python is updated to 3.11.0. Wondering if that may be the issue? The last note leads me to believe that it is to do with the library itself. Answer A the error mentions: ImportError: Installing this module requires OpenSSL python binding…