I am trying to use python to create list of all pairs of numbers between 2 and 75 that average to 54, where each value in each solution pair can go up to 6 decimal places. And so I want to have a list of all of these solution pairs. I have tried using solve()… Read More Finding all possible solution pairs to an algebra problem with constraints in python
So ive done an armstrong number code using python and it works fine till the sum of individual digits but after that it doesnt work i will type the code and send a screenshot to show in picture. number = int(input(‘Enter a number’)) n = len(str(number)) m = s = 0 list1 =  for… Read More Why my python Armstrong number code doesnt work
I am trying to work out why the column names for pandas.concat() are in brackets. There is a similar question here – but in my context I don’t understand how this can be hapenning. It is like there is a double bracket in the assignment, but given the concatenated dataframe looks fine I cannot understand… Read More Why does pandas.concat() add (), to column name
How to merge 2 or more expressions example: 3x + 2y – 2 and 2x + 3y -1 (3x + 2y -2 = 2x + 3y -1) which gives x-y-1 >Solution : from sympy import * # declare symbols var("x, y") # write the two expressions expr1 = 3*x + 2*y – 2 expr2 =… Read More Merge 2 algebraic expression using Sympy
Currently trying to create an automated function that can find a line between two points. Tried testing this function (by plotting) but when I plot the function I get a ‘v-shaped’ line. What changes can I make to complete this function? Thanks. import matplotlib.pyplot as plt from math import e x = [0, 9] y… Read More How can I automate code to plot a line between two points?
After trying to reverse a very simple math formula for the past day, I’ve given up after bumping my head against scipy.special.lambertw — which might not even be the correct place to be looking. I have the following equation: import numpy # The following == 70.03 np.sqrt(np.log(742) * 742) I’m trying to invert that equation… Read More Having trouble inverting a simple math equation using logarithms in Python