Re: [Tutor] Getting started with Pandas

2018-08-22 Thread Alan Gauld via Tutor
On 22/08/18 11:29, Rafael Knuth wrote: > my code below did not require a return statement, hence I was assuming > it wouldn't be needed in my function either. return is only used inside a function, it makes no sense outside (and is a syntax error). Its purpose is to return a value to the caller o

Re: [Tutor] Getting started with Pandas

2018-08-22 Thread Giles Coochey
On 22/08/2018 07:46, Rafael Knuth wrote: import pandas as pd cities_lst = pd.read_table("cool_cities.csv") cities_lst.head() I was trying to rewrite the above as a function. Unlike my code above, my function below did not return the first 5 rows, but just nothing: def cities(file_name):

Re: [Tutor] Getting started with Pandas

2018-08-22 Thread Rafael Knuth
> You are not returning anything. > You need to use the return keyword otherwise your > function just generates the data internally then > throws it away again. ok, got it - thanks. my code below did not require a return statement, hence I was assuming it wouldn't be needed in my function either.

Re: [Tutor] Getting started with Pandas

2018-08-22 Thread Alan Gauld via Tutor
On 22/08/18 07:46, Rafael Knuth wrote: > import pandas as pd > cities_lst = pd.read_table("cool_cities.csv") > cities_lst.head() > > I was trying to rewrite the above as a function. > Unlike my code above, my function below did not return the first 5 > rows, but just nothing: > > def cities(file_

Re: [Tutor] Getting started with Pandas

2018-08-22 Thread Giles Coochey
On 22/08/2018 07:46, Rafael Knuth wrote: import pandas as pd cities_lst = pd.read_table("cool_cities.csv") cities_lst.head() I was trying to rewrite the above as a function. Unlike my code above, my function below did not return the first 5 rows, but just nothing: def cities(file_name):

[Tutor] Getting started with Pandas

2018-08-22 Thread Rafael Knuth
import pandas as pd cities_lst = pd.read_table("cool_cities.csv") cities_lst.head() I was trying to rewrite the above as a function. Unlike my code above, my function below did not return the first 5 rows, but just nothing: def cities(file_name): import pandas as pd cities_lst = pd.read_t

Re: [Tutor] Getting started with Python

2018-07-24 Thread Mats Wichmann
On 07/24/2018 01:55 PM, Aimee Hubbard wrote: > Hi, > I have done some introductory courses with Python, but they did not cover > how to get Python (3.7 version 64 bit) up and running on my own computer. I > have it downloaded on my Windows 10 computer and made sure in my > "Environment Variables" t

[Tutor] Getting started with Python

2018-07-24 Thread Aimee Hubbard
Hi, I have done some introductory courses with Python, but they did not cover how to get Python (3.7 version 64 bit) up and running on my own computer. I have it downloaded on my Windows 10 computer and made sure in my "Environment Variables" that it has the path (C:\Users\aimee6\AppData\Local\Prog

Re: [Tutor] Getting started in testing

2016-05-24 Thread Ben Finney
Terry Carroll writes: > Thanks to Alan, Danny, Albert-Jan and Ben for their suggestions. I've > now gotten my feet wet in unittest and have gone from not quite > knowing where to start to making substantial progress, with a small > suite of tests up and running. Great start! Do keep in mind tha

Re: [Tutor] Getting started in testing

2016-05-24 Thread Terry Carroll
Thanks to Alan, Danny, Albert-Jan and Ben for their suggestions. I've now gotten my feet wet in unittest and have gone from not quite knowing where to start to making substantial progress, with a small suite of tests up and running. ___ Tutor maillist

Re: [Tutor] Getting started in testing

2016-05-21 Thread Ben Finney
Terry Carroll writes: > Is anyone aware of any good tutorials on testing one's Python code? > > Any resources would be helpful. I am aware of the docs on unittest, > but I'm looking for a more tutorial approach. The book Dive Into Python (available both for Python 2 and Python 3) http://www.dive

Re: [Tutor] Getting started in testing

2016-05-21 Thread Albert-Jan Roskam
ject: [Tutor] Getting started in testing > > Is anyone aware of any good tutorials on testing one's Python code? > > These days, I'm a hobby programmer, writing little things just for my own > use, and don't really sweat testing much. But I do have one niche > open

Re: [Tutor] Getting started in testing

2016-05-19 Thread Danny Yoo
On Thu, May 19, 2016 at 12:34 PM, Terry Carroll wrote: > Is anyone aware of any good tutorials on testing one's Python code? > > These days, I'm a hobby programmer, writing little things just for my own > use, and don't really sweat testing much. But I do have one niche > open-source project where

Re: [Tutor] Getting started in testing

2016-05-19 Thread Alan Gauld via Tutor
On 19/05/16 20:34, Terry Carroll wrote: > Is anyone aware of any good tutorials on testing one's Python code? I'm not a big fan of video tutorials but I recently had to teach myself Junit testing (and mockito) in Java and I found that Youtube videos really helped. I know there are similar videos o

[Tutor] Getting started in testing

2016-05-19 Thread Terry Carroll
Is anyone aware of any good tutorials on testing one's Python code? These days, I'm a hobby programmer, writing little things just for my own use, and don't really sweat testing much. But I do have one niche open-source project where I need to be a bit more regimented, and specifically need to

Re: [Tutor] Getting Started

2013-12-19 Thread eryksun
On Thu, Dec 19, 2013 at 8:46 AM, Oscar Benjamin wrote: > So what then is the purpose of running "cmd /c some_console_app"? For > example the git-bash launcher on my desktop runs > C:\WINDOWS\system32\cmd.exe /c ""Q:\TOOLS\Git\bin\sh.exe" --login -i" I guess you're using 32-bit XP. Looking at the

Re: [Tutor] Getting Started

2013-12-19 Thread Oscar Benjamin
On 19 December 2013 12:21, eryksun wrote: > On Thu, Dec 19, 2013 at 4:48 AM, Oscar Benjamin > wrote: >> >> The graphical window that you describe is called cmd.exe and it is the >> standard "terminal emulator" for Windows. > > Oscar, > > cmd doesn't create or manage the console window. That's don

Re: [Tutor] Getting Started

2013-12-19 Thread eryksun
On Thu, Dec 19, 2013 at 4:48 AM, Oscar Benjamin wrote: > > The graphical window that you describe is called cmd.exe and it is the > standard "terminal emulator" for Windows. Oscar, cmd doesn't create or manage the console window. That's done by another process that acts as the console server (co

Re: [Tutor] Getting Started

2013-12-19 Thread Peter Otten
Oscar Benjamin wrote: > I have to qualify my > statement with this caveat to discourage pedants from correcting me. Correction: no practical way to discourage pedants from correcting anyone has been found yet. Your statement has no effect (at best). ;)

Re: [Tutor] Getting Started

2013-12-19 Thread Oscar Benjamin
On 19 December 2013 00:11, Chris Acreman wrote: > > "Can you be more specific about the 'Python screen' ?" -- Amit > "How are you running Python at the moment? Is it just the command line > interpreter? Or do you have some kind of GUI tool?" -- Alan > > The "Python Screen" is what opens up when I

Re: [Tutor] Getting Started

2013-12-19 Thread Alan Gauld
On 19/12/13 06:34, eryksun wrote: you need to set. You can read about them by typing 'help cmd' in the console itself. That's assuming the user ran cmd.exe to use its "help" command. Windows automatically opens a console window for python.exe if the process doesn't inherit one. That's what I w

Re: [Tutor] Getting Started

2013-12-18 Thread eryksun
On Wed, Dec 18, 2013 at 9:28 PM, Alan Gauld wrote: >> The "Python Screen" is what opens up when I click the Python button on >> the desktop. The book calls it a "console window, > > Yes, it's worth getting familiar with it. It provides the ultimate authority > on things like error messages etc. I

Re: [Tutor] Getting Started

2013-12-18 Thread Alan Gauld
On 19/12/13 00:11, Chris Acreman wrote: "But to go further we need to know which OS you are using?" -- Alan I'm using Windows 7. The book assumes a Windows environment, but includes instructions for installing on other systems. OK, I'd recommend getting Activestate's free Python distribution

Re: [Tutor] Getting Started

2013-12-18 Thread Chris Acreman
Amit and Alan, Thank your for your prompt responses to my questions. If you don't mind I will try to merge your questions into a single, hopefully comprehensive response. *** *** *** "But to go further we need to know which OS you are using?" -- Alan I'm using Windows 7. The boo

Re: [Tutor] Getting Started

2013-12-18 Thread Walter Prins
Hi, On 18 December 2013 21:25, Mark Lawrence wrote: > Go to window->preferences->pydev->pylint. > > It works beautifully :) Type something like this as the first two lines in > an editor window:- > > if a == 1: > print('a == 1') > > and it gives you a red bar on the right and a red circle wi

Re: [Tutor] Getting Started

2013-12-18 Thread Mark Lawrence
On 18/12/2013 20:47, Alan Gauld wrote: On 18/12/13 19:21, Mark Lawrence wrote: languages such as Java and C++. For example, I use Eclipse and Pydev and have the static code checker Pylint automatically look at my code as I type. Ooh! that's a new one, how do you set that up? I use Eclipse/Py

Re: [Tutor] Getting Started

2013-12-18 Thread Alan Gauld
On 18/12/13 19:21, Mark Lawrence wrote: languages such as Java and C++. For example, I use Eclipse and Pydev and have the static code checker Pylint automatically look at my code as I type. Ooh! that's a new one, how do you set that up? I use Eclipse/PyDev from time to time but I've never see

Re: [Tutor] Getting Started

2013-12-18 Thread Mark Lawrence
On 17/12/2013 19:47, Chris Acreman wrote: I have programming experience using Fortran, Pascal, Modula 2, and some training in C++. My nephew told me about Python and it sounded intriguing. I downloaded Python 3.3.0 from this website (www.python.org ) and installed it with

Re: [Tutor] Getting Started

2013-12-17 Thread Alan Gauld
On 17/12/13 19:47, Chris Acreman wrote: I have programming experience using Fortran, Pascal, Modula 2, and some training in C++. My nephew told me about Python and it sounded intriguing. I downloaded Python 3.3.0 from this website (www.python.org ) and installed it with no

Re: [Tutor] Getting Started

2013-12-17 Thread Amit Saha
Hello Chris, On Wed, Dec 18, 2013 at 5:47 AM, Chris Acreman wrote: > I have programming experience using Fortran, Pascal, Modula 2, and some > training in C++. My nephew told me about Python and it sounded intriguing. > I downloaded Python 3.3.0 from this website (www.python.org) and installed >

[Tutor] Getting Started

2013-12-17 Thread Chris Acreman
I have programming experience using Fortran, Pascal, Modula 2, and some training in C++. My nephew told me about Python and it sounded intriguing. I downloaded Python 3.3.0 from this website (www.python.org) and installed it with no apparent difficulty. To learn the language I bought a book fr

Re: [Tutor] Getting started with PyGTK [Receiving Error]

2012-04-29 Thread Russel Winder
Santosh, On Sun, 2012-04-29 at 04:18 +0530, Santosh Kumar wrote: > System Information > > Ubuntu 11.10 > Python 2.7.2 > > Problem > > > I think my Ubuntu has PyGTK and GTK both already installed. But > however when I am importing "gtk" in Python interact

Re: [Tutor] Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Russell Smith
Make sure you installed the theme engine 'pixmap' or whichever gtk package that has the theme engine you are missing. Google search for the gtk packages. Look here http://askubuntu.com/questions/66356/gdk-gtk-warnings-and-errors-from-the-command-lineand you will see a very similar problem with a so

Re: [Tutor] Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Alan Gauld
On 28/04/12 23:48, Santosh Kumar wrote: System Information Ubuntu 11.10 Python 2.7.2 Problem I think my Ubuntu has PyGTK and GTK both already installed. You should be able to confirm that by checking in Synaptic. however when I am importing "gtk" in

[Tutor] Getting started with PyGTK [Receiving Error]

2012-04-28 Thread Santosh Kumar
System Information Ubuntu 11.10 Python 2.7.2 Problem I think my Ubuntu has PyGTK and GTK both already installed. But however when I am importing "gtk" in Python interactive mode then I am getting the following warning: (.:4126): Gtk-WARNING **: Unable to

Re: [Tutor] Getting started with Python

2008-05-16 Thread jay
rom:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On > Behalf Of *jay > *Sent:* Friday, May 16, 2008 9:44 AM > *To:* tutor@python.org > *Subject:* Re: [Tutor] Getting started with Python > > Have you tried this ? > > import sys > sys.path.append('/directory1/d

Re: [Tutor] Getting started with Python

2008-05-16 Thread Hansen, Mike
t: Re: [Tutor] Getting started with Python Have you tried this ? import sys sys.path.append('/directory1/directory2') import file.py j On Fri, May 16, 2008 at 10:20 AM, Moishy Gluck &l

Re: [Tutor] Getting started with Python

2008-05-16 Thread jay
Have you tried this ? import sys sys.path.append('/directory1/directory2') import file.py j On Fri, May 16, 2008 at 10:20 AM, Moishy Gluck <[EMAIL PROTECTED]> wrote: > > > On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck <[EMAIL PROTECTED]> > wrote: > >> You need to place a "__init__.py" file in

Re: [Tutor] Getting started with Python

2008-05-16 Thread Moishy Gluck
On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck <[EMAIL PROTECTED]> wrote: > You need to place a "__init__.py" file in a directory you want to reference > in an import statement. > > I don't believe the content of the file is important but you can place code > in the file that will affect how files

[Tutor] Getting started with Python

2008-05-16 Thread ppaarrkk
I can't. >>> import file.py is all very well if the interpreter knows where file.py is. I want to do this : >>> import /directory1/directory2/file.py Is this not possible ? -- View this message in context: http://www.nabble.com/Getting-started-with-Python-tp17273337p17273337.html Sent

Re: [Tutor] Getting Started with Python

2006-09-11 Thread Kent Johnson
tomd wrote: > Hi Will, > > do a search in the archives, plenty of similar discussions, even just > few days ago. Try http://wiki.python.org/moin/BeginnersGuide/NonProgrammers > > (Admins: consider sending a welcome message on the subscription to > each newcomer specifying usually recommended sour

Re: [Tutor] Getting Started with Python

2006-09-11 Thread tomd
Hi Will, do a search in the archives, plenty of similar discussions, even just few days ago. Try http://wiki.python.org/moin/BeginnersGuide/NonProgrammers (Admins: consider sending a welcome message on the subscription to each newcomer specifying usually recommended sources.) > just recently hav

[Tutor] Getting Started with Python

2006-09-11 Thread Will Shattuck
Hi all, I started going through the [Tutor] archives looking for resources on where to start. I have wanted to program for many years, but only just recently have made the time. I thought through different languages to start with: C, C# (My work uses .NET), Java, Python, Ruby, and others. I thi

Re: [Tutor] Getting started - IDLE won't run

2006-03-23 Thread Shaun Ross
Sent: Thursday, March 23, 2006 1:04 PM Subject: Re: [Tutor] Getting started - IDLE won't run Hello Ross,Can you see pythonw in the task manager process after you run idle ?Please look at this website concerning some firewall that can stop idle:http://www.python.org/dow

Re: [Tutor] Getting started - IDLE won't run

2006-03-23 Thread Shaun Ross
t; <[EMAIL PROTECTED]> To: "Shaun Ross" <[EMAIL PROTECTED]>; Sent: Tuesday, January 01, 2002 6:16 PM Subject: Re: [Tutor] Getting started - IDLE won't run >> The problem is that Python GUI (IDLE) doesn't run properly. > > I assume you found the

Re: [Tutor] Getting started - IDLE won't run

2006-03-23 Thread Alan Gauld
> The problem is that Python GUI (IDLE) doesn't run properly. I assume you found the stuff about enabling the firewall to allow comms to 127.0.0.1(localhost)? There is a reference to the problem on the Python web site but the fix depends on your firewall. Try disabling the firewall temporaril

Re: [Tutor] Getting started - IDLE won't run

2006-03-23 Thread Pujo Aji
Hello Ross,Can you see pythonw in the task manager process after you run idle ?Please look at this website concerning some firewall that can stop idle: http://www.python.org/download/releases/2.4.2/bugs/Cheers,pujoOn 3/23/06, Shaun Ross <[EMAIL PROTECTED] > wrote: Hi Group,   I'm just getting

[Tutor] Getting started - IDLE won't run

2006-03-23 Thread Shaun Ross
Hi Group,   I'm just getting started with Python. I've downloaded and installed the latest version (2.4.2 for Windows). I'm running Windows XP Prow SP2 on my Toshiba Satellite P4 Centrino 2GHz with 2GB RAM. I'm using Trend-Micro PC-Cillin 2006 anti-virus & firewall.   The problem is that Pyth

Re: [Tutor] Getting started

2005-07-20 Thread Pujo Aji
try python 2.4.1 from this web site: http://www.python.org/download/ cheers, pujo On 7/20/05, Brett C. <[EMAIL PROTECTED]> wrote: > Which Python version should I download, I have Windows XP and am just > getting started in the programming area so alot of the descriptions are to > confusing for

[Tutor] Getting started

2005-07-20 Thread Brett C.
Which Python version should I download, I have Windows XP and am just getting started in the programming area so alot of the descriptions are to confusing for me to understand, anyhelp would be appreciated ___ Tutor maillist - Tutor@python.org http:

Re: [Tutor] Getting started in jython

2005-07-07 Thread D. Hartley
I don't know if this will be useful to everyone, but I found the O'Reilly book wasn't so helpful to those starting with Python and moving to Jython (i.e., rather than starting with Java and not knowing Python). I have yet to find Jython materials that are very good for beginners - most everything

Re: [Tutor] Getting started in jython

2005-07-07 Thread Alan G
> I'm a semi-competent python user who has discovered that all the > toolkits I really have use of are bound up in java classes. I can cope > with this, because there is Python, but I was wondering if anyone who > has spent more time around it than I have could spare any advice that > will make t

[Tutor] Getting started in jython

2005-07-07 Thread Andrew D. Fant
I'm a semi-competent python user who has discovered that all the toolkits I really have use of are bound up in java classes. I can cope with this, because there is Python, but I was wondering if anyone who has spent more time around it than I have could spare any advice that will make the adjustme