Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99914
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Question about split method |
| Date | 2015-12-02 14:44 -0600 |
| Message-ID | <mailman.147.1449089117.14615.python-list@python.org> (permalink) |
| References | <169982db-7285-484a-9a48-0d4a2ea7dea1@googlegroups.com> |
On Wed, Dec 2, 2015 at 2:37 PM, Robert <rxjwg98@gmail.com> wrote:
> Hi,
>
> I learn split method online. When I try to run the line with ss1 beginning,
> I don't understand why its output of ss1 and ss2. I have check the help
> about split. It looks like that it is a numpy method.
> What is the split method parameter (within " ") for?
>
>
> Thanks,
>
>
>
> ...............
> ss0="1, 2, 4, 8, 16".split(", ")
>
> ss0
> Out[2]: ['1', '2', '4', '8', '16']
>
> ss1="1, 2, 4, 8, 16".split(" , ")
>
> ss1
> Out[4]: ['1, 2, 4, 8, 16']
>
> ss2="1, 2, 4, 8, 16".split(", ")
>
> ss2
> Out[9]: ['1, 2, 4, 8, 16']
>
> help(split)
> Help on function split in module numpy.lib.shape_base:
That's just some random function that you've imported into globals by
doing "from numpy import *" or some such. What you're calling in these
examples is a string method, not a global function.
Try help(str.split)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Question about split method Robert <rxjwg98@gmail.com> - 2015-12-02 12:37 -0800
Re: Question about split method Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-02 14:44 -0600
Re: Question about split method Robert <rxjwg98@gmail.com> - 2015-12-02 13:00 -0800
Re: Question about split method Peter Pearson <pkpearson@nowhere.invalid> - 2015-12-05 19:29 +0000
Re: Question about split method Robert <rxjwg98@gmail.com> - 2015-12-05 11:51 -0800
Re: Question about split method Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-05 20:27 +0000
Re: Question about split method Erik <python@lucidity.plus.com> - 2015-12-05 22:20 +0000
csiph-web