Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Memory error while recursively adding np.arrays
Post: Memory error while recursively adding np.arrays

I keep getting this memory error. I'm trying to calculate Y values for an array recursively, but it's not working. Anyone see where I'm going wrong? Error:Traceback (most recent call last): File "...
Afterdarkreader Data Science 0 4,018 Dec-22-2017, 04:02 PM
    Thread: If loop inside of a while loop
Post: RE: If loop inside of a while loop

OH OKAY, that's the problem. I completely missed that typo. Thanks ya'll! **smile**
Afterdarkreader Data Science 4 3,663 Dec-20-2017, 09:03 PM
    Thread: Python don't divide
Post: RE: Python don't divide

Print out the numerator and denominator and make sure that's correct. I almost guarantee that's your problem
Afterdarkreader General Coding Help 8 5,246 Dec-20-2017, 09:02 PM
    Thread: If loop inside of a while loop
Post: If loop inside of a while loop

I have a problem where, I'm trying to use an if loop inside of a while loop to create an array. Its running infinitely. Anyone see my problem? import numpy as np x = np.linspace(1, 100, num = 100) ...
Afterdarkreader Data Science 4 3,663 Dec-20-2017, 08:50 PM
    Thread: Memory error in python 2.7
Post: RE: Memory error in python 2.7

They're the same code, but here's the error code for the abbreviated version I'm using to debug (it's the exact same code, just minus repeated functions that I know work fine). First error Error:Trac...
Afterdarkreader Data Science 4 6,505 Dec-20-2017, 02:26 AM
    Thread: Memory error in python 2.7
Post: RE: Memory error in python 2.7

oh, sorry, that's just because this is abbreviated code. I cut out a bunch of repeat stuff so that it would be easier to read, the traceback error is the same though.
Afterdarkreader Data Science 4 6,505 Dec-20-2017, 12:29 AM
    Thread: something that returns a linear function compatible with lognorm.pdf and lognorm.cdf?
Post: RE: something that returns a linear function compa...

It's a question about numpy and scipy. I'm using the lognorm function in scipy.stats, and I need to add a linear growth function. I was wondering if anyone knew a function I could use that would make ...
Afterdarkreader Data Science 2 3,233 Dec-19-2017, 10:42 PM
    Thread: something that returns a linear function compatible with lognorm.pdf and lognorm.cdf?
Post: something that returns a linear function compatibl...

I'm trying to figure out how to make a lognorm function compatible with a linear function. Any ideas? **blush**
Afterdarkreader Data Science 2 3,233 Dec-19-2017, 10:08 PM
    Thread: Memory error in python 2.7
Post: Memory error in python 2.7

Here's my errpr message, last time I got this I had a logic error in a loop, but I can't find anything like that in this. Does anyone spot my problem? Error:runfile('C:/Users/after/OneDrive/Distincti...
Afterdarkreader Data Science 4 6,505 Dec-19-2017, 08:48 PM
    Thread: cannot convert float infinity to integer error despite rounding off floats
Post: RE: cannot convert float infinity to integer error...

I want int(format()) to round off to 5 decimal places, but because it returns a string. I want it to be a integer, so I added the int() Note, I've also been trying: y = '{:0.3e}'.format(y) y = float(...
Afterdarkreader General Coding Help 3 15,229 Dec-14-2017, 10:02 PM
    Thread: Using a list as a Y value in a python graph
Post: RE: Using a list as a Y value in a python graph

I figured out the problem. X and Y did not have the same number of values. I adjusted my timesteps so they were the same in both and I got the program to run!
Afterdarkreader Data Science 5 3,847 Dec-14-2017, 07:31 PM
    Thread: cannot convert float infinity to integer error despite rounding off floats
Post: cannot convert float infinity to integer error des...

So here's the full error information Error:Traceback (most recent call last): File "<ipython-input-41-862883395604>", line 1, in <module> runfile('C:/Users/after/OneDrive/Distincti...
Afterdarkreader General Coding Help 3 15,229 Dec-14-2017, 07:29 PM
    Thread: Using a list as a Y value in a python graph
Post: RE: Using a list as a Y value in a python graph

Here's where I am now and here's the error information: def yFunction(initialPop, popGrowth): y=initialPop yList = np.array([]) x=0 while x < 400: np.append(yList, y) ...
Afterdarkreader Data Science 5 3,847 Dec-14-2017, 05:34 PM
    Thread: Using a list as a Y value in a python graph
Post: Using a list as a Y value in a python graph

SO I have a function that returns a list and I want to use it as the Y value of a function. I'm currently getting an 'x and y must have the same first value' error. Anyone see the problem in my code?...
Afterdarkreader Data Science 5 3,847 Dec-13-2017, 07:57 PM
    Thread: Using np.linspace, creating a recursive graph
Post: Using np.linspace, creating a recursive graph

Okay so I know I post on this project a lot, but I'm very new to python coding, and this has been very helpful. Basically I have a new run time issue wherein I have my function subtracting from the t...
Afterdarkreader General Coding Help 0 1,979 Dec-12-2017, 07:20 PM
    Thread: Trouble with creating a looping function in python 2.7 (complex)
Post: RE: Trouble with creating a looping function in py...

I finally made it work! Thanks for giving me some tips! **biggrin** I ended up creating a list and appending each run of the function to that list. Originally I just returned the list, but then I re...
Afterdarkreader Data Science 3 3,125 Dec-12-2017, 06:56 PM
    Thread: Question about calling a function that calls a function
Post: RE: Question about calling a function that calls a...

Right, I got that. Now I'm trying this, but it's giving me a different error. import numpy as np from scipy.stats import lognorm import matplotlib.pyplot as plt from math import exp fig, ax = plt.subp...
Afterdarkreader Data Science 9 5,015 Dec-09-2017, 10:02 PM
    Thread: Question about calling a function that calls a function
Post: RE: Question about calling a function that calls a...

see but if I do this: def runVeganuaryMain(x): testTime = 48 while testTime < 400: testTime = testTime + 4 return Veganuary(testTime, testTime+1, x, 0.006, 0.012, 0.55)it pu...
Afterdarkreader Data Science 9 5,015 Dec-09-2017, 09:50 PM
    Thread: Question about calling a function that calls a function
Post: Question about calling a function that calls a fun...

I have a pretty complex calculation that calls several different functions. One of them needs to loop. I think the method I have here SHOULD be working, but it keeps giving me an 'X and Y must have t...
Afterdarkreader Data Science 9 5,015 Dec-09-2017, 09:20 PM
    Thread: Trouble with creating a looping function in python 2.7 (complex)
Post: RE: Trouble with creating a looping function in py...

Here's what I'm trying now. It's returning a bunch of pretty colors in a graph, but nothing particularly useful.import numpy as np from scipy.stats import lognorm import matplotlib.pyplot as plt from ...
Afterdarkreader Data Science 3 3,125 Dec-09-2017, 08:27 PM

User Panel Messages

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