Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: ts.plot() pandas: No plot! Date: Mon, 1 Feb 2016 12:15:26 +1100 Lines: 58 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Jl9YahH7uIRnHruFpwOs1gHde2S14nTW0fm2f07QleRw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pop': 0.05; 'skip:" 60': 0.05; 'valueerror:': 0.07; 'versions.': 0.07; 'wrapper': 0.07; 'cc:addr:python-list': 0.09; 'exception,': 0.09; 'lost.': 0.09; 'subject:plot': 0.09; 'exception': 0.13; '2016': 0.16; '89,': 0.16; '__new__': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hmm.': 0.16; 'paulo': 0.16; 'python3.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'string': 0.17; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '"",': 0.22; 'parsing': 0.22; 'am,': 0.23; 'bit': 0.23; 'feb': 0.23; 'tried': 0.24; '(most': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'sort': 0.25; "doesn't": 0.26; 'example': 0.26; 'skip:" 20': 0.26; 'error': 0.27; 'handling': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; '**kwargs)': 0.29; 'matplotlib': 0.29; 'tutorial': 0.29; 'there.': 0.30; "i'm": 0.30; 'normally': 0.30; 'another': 0.32; 'returned': 0.32; 'run': 0.33; 'changed': 0.33; 'traceback': 0.33; 'file': 0.34; 'skip:d 20': 0.34; 'running': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'skip:p 30': 0.35; 'received:209.85': 0.36; 'possible': 0.36; 'subject:: ': 0.37; 'expect': 0.37; 'received:209.85.213': 0.37; 'difference': 0.38; 'received:209': 0.38; 'skip:p 20': 0.38; 'some': 0.40; 'your': 0.60; 'between': 0.65; 'chrisa': 0.84; 'func(*args,': 0.84; 'gui?': 0.84; 'happening?': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=K3JS8uXtPKKOYRKLD3XKsts2UoLAuzv/sc643NKoWOg=; b=hw5VQ4qbJpnG2k+Qo6gl9G7aiEQLz10geCq6ZxK0FJhbSYI/ELsMw3AwFeW2iNLvyl ulgQyV9XoMdaSj65h4LJhTYoKrwNvgENdK55HKZ98tb3af6pA3QPphMwO07eATcKnMJq 1QtBV9+q+gFBXJQg9eOcjfvdowyQ0CNo8qC4vD+k258gPMYaB8XSqQIQRQQhMym+NsHw jgFtJZKEoK1X2VWVOjA6NCU2j75M3Clk/amEop+h8mhJGLejb5oZv/W2S5mMJQqtuWrt vxSih4hdfVsKJ9isjioUpE7/7gp40rVyOQ9HbfluVCh3eZfMIr/VwrPz6yWFZMGSfBz9 UGdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=K3JS8uXtPKKOYRKLD3XKsts2UoLAuzv/sc643NKoWOg=; b=lXaiRmsMeVze81uR/Fu7D6aRaRGKCBNbg+wbEXIZd6Oja72bdBe9777/U2gOGgnQkz I6eKSQWdBYT4+yxlPFbDxCJ0uCK9Uh0iwCTRLl25Tvva9mIBx7eaUiUf3EjAxP1mka0b VD7dSyg+8D+e+exzLvTYWylNuY+bs6hStQf61FtXB6SaDUSAs/MbLfJKvv5kYEMNMwmQ t3ZA94HU05Jdq966wblqBAbtBfvnU1LmCERIv5ugigiu0VypPPv7MLUlQ/hX5q7TDl/A u9H8hgZLoU8W4UEGm8b4Gp9ehbeMCJhhE2Yi3yqq3qJSb/XgwgpyrTCM9vhNyCuhBzqx VvJA== X-Gm-Message-State: AG10YOTDHxH5akkWFJQAXcfKwgZy1mvUtQ0+1kpr3Byy+Nq8lKAbzvvUkz6Wu64J+FSDx1gMi5VCArNrQhQ8sA== X-Received: by 10.50.111.169 with SMTP id ij9mr8653147igb.92.1454289326714; Sun, 31 Jan 2016 17:15:26 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102376 On Mon, Feb 1, 2016 at 11:46 AM, Paulo da Silva wrote: > I am learning pandas and following the tutorial I tried the following: > ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', > periods=1000)) > ts = ts.cumsum() > ts.plot() > > No plot is produced! > Only the following output: > > > Any clue on what is happening? > > I'm using kubuntu and python3. > Hmm. Normally I would expect matplotlib to pop up a graph there. Are you running this from a terminal, or from some sort of GUI? It might make a difference to how it brings up the graph. Interestingly, I'm not able to run your example on my system: >>> pd.__version__ '0.17.1' >>> pd.date_range('1/1/2000', periods=1000) ValueError: Error parsing datetime string "1/1/2000" at position 1 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.6/site-packages/pandas/tseries/index.py", line 1923, in date_range closed=closed, **kwargs) File "/usr/local/lib/python3.6/site-packages/pandas/util/decorators.py", line 89, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/pandas/tseries/index.py", line 237, in __new__ ambiguous=ambiguous) File "/usr/local/lib/python3.6/site-packages/pandas/tseries/index.py", line 379, in _generate start = Timestamp(start) File "pandas/tslib.pyx", line 299, in pandas.tslib.Timestamp.__new__ (pandas/tslib.c:8973) File "pandas/tslib.pyx", line 1163, in pandas.tslib.convert_to_tsobject (pandas/tslib.c:22522) File "pandas/tslib.pyx", line 1271, in pandas.tslib.convert_str_to_tsobject (pandas/tslib.c:24121) File "pandas/src/datetime.pxd", line 141, in datetime._string_to_dts (pandas/tslib.c:80505) SystemError: returned a result with an error set So it's possible you've run into something that's changed between versions. Your original example works on my 2.7, although it doesn't pop up a graph. So now I'm a bit lost. :) ChrisA