Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to solve equations, with groups of variables and or constraints?
Post: How to solve equations, with groups of variables a...

I need a way to formulate a series of equations that are about finding at least one combination of groups of variables, that added together, equal a certain sum. Example time: (A,B)+(C,D,E)=3 This m...
ThemePark General Coding Help 0 1,680 Oct-05-2020, 07:22 PM
    Thread: Replacing sub array in Numpy array
Post: RE: Replacing sub array in Numpy array

(Apr-01-2020, 01:52 AM)scidam Wrote: (Mar-30-2020, 07:24 PM)ThemePark Wrote: Now it's on to multidimensional arrays.The same rules are true for multidimensional cases. import numpy as np x=np.ones...
ThemePark Data Science 5 4,168 Apr-01-2020, 01:16 PM
    Thread: Inserting slice of array objects into different slice
Post: RE: Inserting slice of array objects into differen...

(Apr-01-2020, 04:35 AM)perfringo Wrote: The problem is exactly described in error message: you can't broadcast shape 2,1 into shape 2.But it obviously doesn't describe a solution, and a ton of resea...
ThemePark Data Science 4 2,535 Apr-01-2020, 01:10 PM
    Thread: Inserting slice of array objects into different slice
Post: RE: Inserting slice of array objects into differen...

(Mar-31-2020, 06:52 PM)deanhystad Wrote: Shouldn't it be: a = np.zeros((2,), dtype=np.object) (2) is an int, (2,) is s tuple No, it shouldn't.
ThemePark Data Science 4 2,535 Mar-31-2020, 08:30 PM
    Thread: Inserting slice of array objects into different slice
Post: Inserting slice of array objects into different sl...

Suppose I have the following code: import numpy as np a=np.zeros((2),dtype=np.object) b=np.array([[11],[13]]) a[0]=b[0] a[1]=b[1] print(a)This gives me the wanted result of "[array([11]) array([13])]"...
ThemePark Data Science 4 2,535 Mar-30-2020, 07:33 PM
    Thread: Replacing sub array in Numpy array
Post: RE: Replacing sub array in Numpy array

And nevermind my previous post. It took me a while but I finally figured out how it works and actually got some similar code to run. Now it's on to multidimensional arrays.
ThemePark Data Science 5 4,168 Mar-30-2020, 07:24 PM
    Thread: Replacing sub array in Numpy array
Post: RE: Replacing sub array in Numpy array

(Mar-18-2020, 10:06 AM)scidam Wrote: You cann't do this with default dtype (np.float64). However, numpy arrays are mutable, so, if you define a-array with dtype= np.object,everything should work fi...
ThemePark Data Science 5 4,168 Mar-29-2020, 06:35 AM
    Thread: Replacing sub array in Numpy array
Post: Replacing sub array in Numpy array

I'm trying to replace a sub array in a Numpy array, with an array of the same shape, such that any changes are mirrored in both arrays. I've run the following code in IDLE. >>> import numpy ...
ThemePark Data Science 5 4,168 Mar-18-2020, 04:19 AM
    Thread: Converting set of tuples to set of 2D numpy arrays
Post: Converting set of tuples to set of 2D numpy arrays

I have coded a function that returns a set of tuples, each tuple being of size 6, and assigned it to a var named tmp. Now I need to convert each tuple to a numpy array so I can reshape it into a 2x3 a...
ThemePark Data Science 0 2,610 Aug-04-2019, 05:07 PM
    Thread: Global variables not changing
Post: Global variables not changing

I've had a problem with some code where a global variable reverted back to its previous value, after a function completed, despite the variable being named global in that same function. To illustrate,...
ThemePark General Coding Help 3 2,801 Mar-02-2019, 06:55 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020