Skip to content

Tag: python

Python module Wikipedia producing the wrong answer

Code It for some reason changes einstein family to epstein family and i have no idea why does anyone know why this error occurs? Answer Change the to I was looking through the wikipedia.py file and found that auto_suggest can change your RESULTS[i] to a close approximation and so by turning it to False it sto…

globas and exec in python

I have written code, to create variable and assign values using for loop. but I am getting result as None but even I tried to change the code with below modification, still getting the same Can some one help me to get the proper answer for this. Note: even I used exec function in the place of name (ex: exec(f…

Python Element-wise Multiplication

In MATLAB, I do a calculation using Here, A and B are 1*19-sized matrices. To execute the same code in Python, I am using the following code- Upon running the code, I get the following error- What should I do? Answer MATLAB’s .* is a broadcasting operator. It scalar-extends the * operator to apply to ma…

Plot Between Certain Y axis Values

I’m plotting some values using Pandas. But my Values are soo close together It doesn’t actually show anything. Is there a way to restrict Y-axis to “Zoom in” on the differences? And then really show the difference between the value even though there isn’t much..? Answer You can a…

replace a symbol in the same line of multistring

I am doing a python project, its a review maker kind using a sample string and replacing the symbol in the same line of the multistring then printing it with (check mark) next to the same text in the string as user input , I have a problem in replacing a certain symbol (☑) with the same line of string

pyproj conversion UTM to lat/long out by 3 deg

I am reading UTM point data from a shape file. The geopandas CRS string associated with the shape file is: I convert the point data to lat/long using pyproj: This gives me the correct latitude but the longitude is exactly 3 degrees out. I changed the UTM zone to utm=+20 but now am 3 degress out in the other d…

python3 join lists that have same value in list of lists

I have similar question to one that has been asked several years ago, the link is down here. the thing is that all answers are in python 2 and does work for me. my lists are huge so time is important. if anyone can solve that for python3, that will really help. Consider this list of lists: I want to

How to solve Luhn algoritm

there is a lot of information about how to write Luhn algortim. I’m trying it too and I think that I’am very close to succes but I have some mistake in my code and dont know where. The test card is VALID card but my algorithm says otherwise. Don’t you know why? Thx for help Finally! Thank yo…