Rémi Lapeyre <[email protected]> added the comment:
I don't understand the motivation, why would it be very useful when working
with titles of columns that are to be used in databases columns?
Databases can handle columns with spaces in their name:
postgres=# create temporary table foo ("column with spaces" text);
CREATE TABLE
Time: 29,973 ms
postgres=# insert into foo values ('bar');
INSERT 0 1
Time: 0,746 ms
postgres=# select * from foo;
column with spaces
--------------------
bar
(1 row)
Time: 3,452 ms
There is also various library available to do this on Pypi like
https://github.com/okunishinishi/python-stringcase and
https://github.com/jpvanhal/inflection. I'm pretty sure I used inflection at
one company and it worked great.
Finally, the issue on the Pandas repository says how to do it: you can use
Series.apply.
----------
nosy: +remi.lapeyre
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40437>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com