Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Don Jennings
On Dec 16, 2013, at 11:56 AM, eva maria gualandi wrote: > Good afternoon, > I installed from https://pypi.python.org/pypi/statsmodels the package > statsmodels for python 2.7 (32bit) , i have to do some test statistics for a > time series analysis that i can find under statsmodels.tsa. In part

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Derry, James R
hi, eva, when i ran your code i found a misspell: result = statsmodels.tsa.statools.adfuller(x,1) when i fixed 'stattools' -- result = statsmodels.tsa.stattools.adfuller(x,1) print result (-2.6825663173365015, 0.077103947319183241, 0, 7, {'5%': -3.4775828571428571, '1%': -4.9386902332361515, '

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Alan Gauld
On 16/12/13 16:56, eva maria gualandi wrote: ) i run this simple programm import numpy as np import statsmodels from statsmodels.tsa import stattools x = np.array([1,2,3,4,3,4,2,3]) result = statsmodels.tsa.statools.adfuller(x,1) Since you explicitly imported stattools you only need to cal

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Steven D'Aprano
Hello Eva, On Mon, Dec 16, 2013 at 05:56:36PM +0100, eva maria gualandi wrote: [...] > but unfortunately i get the following error message: > > Traceback (most recent call last): > File "C:\Python27\esempio_adftest.py", line 3, in > from statsmodels.tsa import stattools [...] > from pa

Re: [Tutor] Built In Functions

2013-12-16 Thread Steven D'Aprano
On Mon, Dec 16, 2013 at 05:15:28PM +, Alan Gauld wrote: > On 16/12/13 15:28, Rafael Knuth wrote: > > >First question: all(iterable) and any(iterable) - can you give me one > >or two examples what these functions do and how they are specifically > >used? > > In my experience they aren't used a

[Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread eva maria gualandi
Good afternoon, I installed from *https://pypi.python.org/pypi/statsmodels *the package statsmodels for python 2.7 (32bit) , i have to do some test statistics for a time series analysis that i can find under statsmodels.tsa. In particular i really need to

Re: [Tutor] Built In Functions

2013-12-16 Thread Danny Yoo
all('') > True > > Actually the last one surprised me. I expected false. So maybe a resident > guru can explain that anomaly... I assume it works on the basis of testing > until it finds a false and so an empty sequence > always returns true... The term you're thinking of is "vacuous truth"

Re: [Tutor] Built In Functions

2013-12-16 Thread spir
On 12/16/2013 04:28 PM, Rafael Knuth wrote: Hey there, I am currently looking into all built in functions in Python 3.3.0, one by one, in order to understand what each of them specifically does (I am familiar with some of them already, but most built in functions are still alien to me). I am wor

Re: [Tutor] Continue Statement

2013-12-16 Thread spir
On 12/16/2013 03:12 PM, Alina Campana wrote: Hello dear tutorlist, I feel terribly ashamed for my bad english... Yet I'll try to form my question: It is about the continue statement in python.I wrote this code i = 0while (i < 10): if i == 5: continueprint i i+=1 What i expect

Re: [Tutor] Continue Statement

2013-12-16 Thread Peter Otten
Alina Campana wrote: > Hello dear tutorlist, Welcome! > I feel terribly ashamed for my bad english... > Yet I'll try to form my question: > It is about the continue statement in python.I wrote this code > i = 0while (i < 10): if i == 5: continueprint i i+=1 > What i expecte

Re: [Tutor] Built In Functions

2013-12-16 Thread Alan Gauld
On 16/12/13 15:28, Rafael Knuth wrote: First question: all(iterable) and any(iterable) - can you give me one or two examples what these functions do and how they are specifically used? In my experience they aren't used all that often. But the logic is straightforward. all(seq) returns true if

Re: [Tutor] Continue Statement

2013-12-16 Thread Mark Lawrence
On 16/12/2013 14:12, Alina Campana wrote: Hello dear tutorlist, I feel terribly ashamed for my bad english... Please *DO NOT* apologise for your English, it's an extremely difficult language. Yet I'll try to form my question: It is about the continue statement in python. I wrote this cod

Re: [Tutor] Continue Statement

2013-12-16 Thread Alan Gauld
On 16/12/13 14:12, Alina Campana wrote: Please use plain text for emails. Rich text tends to mess up the indentation as you can see below. However via the web interface I was able to see what you did so... i = 0 while (i < 10): if i == 5: continue print i i+=1 Instead it seems to freeze af

Re: [Tutor] Built In Functions

2013-12-16 Thread Peter Otten
Rafael Knuth wrote: > Hey there, > > I am currently looking into all built in functions in Python 3.3.0, > one by one, in order to understand what each of them specifically does > (I am familiar with some of them already, but most built in functions > are still alien to me). I am working with the

[Tutor] Continue Statement

2013-12-16 Thread Alina Campana
Hello dear tutorlist, I feel terribly ashamed for my bad english... Yet I'll try to form my question: It is about the continue statement in python.I wrote this code i = 0while (i < 10):if i == 5: continueprint i i+=1 What i expected was an output like12346789 Instead it see

[Tutor] Built In Functions

2013-12-16 Thread Rafael Knuth
Hey there, I am currently looking into all built in functions in Python 3.3.0, one by one, in order to understand what each of them specifically does (I am familiar with some of them already, but most built in functions are still alien to me). I am working with the Python documentation http://docs

Re: [Tutor] Prime Numbers

2013-12-16 Thread Steven D'Aprano
On Mon, Dec 16, 2013 at 09:49:23AM +0100, Rafael Knuth wrote: > That's actually a good example. Let me explain what I feel confused about. > Print actually runs through the entire loop. No it doesn't. Print has nothing to do with loops. It just happens that the body of the loop -- the thing that

Re: [Tutor] Prime Numbers

2013-12-16 Thread spir
On 12/16/2013 09:49 AM, Rafael Knuth wrote: Hej there, number = 9 for element in range(2,9): 3 % 2 != 0: My assumption is that the program should end the loop after the first iteration again and it then should return True. No. If it did that, it wouldn't be a *loop* at all, would it? The whol

Re: [Tutor] Quantum computing

2013-12-16 Thread Oscar Benjamin
On 15 December 2013 16:25, Steven D'Aprano wrote: > On Sun, Dec 15, 2013 at 03:40:38PM +, Mark Lawrence wrote: >> On 15/12/2013 04:55, William Ray Wing wrote: > >> >Well, as it turns out, there actually *IS* a commercially available >> >quantum computer on the market today. >> >> Are you sayin

Re: [Tutor] Prime Numbers

2013-12-16 Thread spir
On 12/16/2013 11:34 AM, spir wrote: On 12/15/2013 05:54 PM, Rafael Knuth wrote: PS: using "print" as Mark proposes is indeed you best friend to unsertand loops (and also recursion). Denis ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

Re: [Tutor] Prime Numbers

2013-12-16 Thread spir
On 12/15/2013 05:54 PM, Rafael Knuth wrote: Hej, I stumbled upon this program here (Python 3.3.0) and I don't quite understand how the for loop plays with the return True statement: def is_prime(number): for element in range(2, number): if number % element == 0: retur

Re: [Tutor] Prime Numbers

2013-12-16 Thread Andreas Perstinger
On 16.12.2013 09:49, Rafael Knuth wrote: That's the tiny little detail I am confused about: What does return exactly do? Does it return only the first value within a loop or does it iterate through all values within a loop? (unless a given condition is met) The return statement has nothing to d

Re: [Tutor] Prime Numbers

2013-12-16 Thread Rafael Knuth
Hej there, >> number = 9 >> for element in range(2,9): >> 3 % 2 != 0: >> My assumption is that the program should end the loop after the first >> iteration again and it then should return True. > > No. If it did that, it wouldn't be a *loop* at all, would it? The whole > reason loops (for and whil