On Sat, Nov 12, 2016 at 12:06 PM Steven D'Aprano
wrote:
> I consider the need for that to indicate a possibly poor design of
> pandas. Unless there is a good reason not to, I believe that any
> function that requires a list of strings should also accept a single
> space-delimited string instead.
On Sat, Nov 12, 2016 at 11:33 AM David Mertz wrote:
> Just spend the extra two characters to do this with existing syntax:
> w('field1 field2 field3'). Implementation of the w() function is trivial.
>
>
I've done that as well and see that done. Sometimes with s('field1
field2'), sometimes with
= w'field1 field2' + other_fields
# ERROR - can't concatenate list to tuple
new_columns = list(w'field1 field2') + other_fields
I honestly could go either way with lists or tuples.
Other Languages:
perl has the qw operator:
@a = qw(field1 field2 field3);
ruby has %w