how to remove the punctuation and no need words from paragraphs

View: New views
2 Messages — Rating Filter:   Alert me  

how to remove the punctuation and no need words from paragraphs

by kylin-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to remove all the punctuation and no need words form a string
datasets for experiment.

I am new to python, please give me some clue and direction to write
this code.
--
http://mail.python.org/mailman/listinfo/python-list

Re: how to remove the punctuation and no need words from paragraphs

by Chris Rebert-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 3, 2009 at 1:44 PM, kylin <huili.song@...> wrote:
> I want to remove all the punctuation and no need words form a string
> datasets for experiment.
>
> I am new to python, please give me some clue and direction to write
> this code.

The `replace` method of strings should get you pretty far (just
replace unwanted stuff with the empty string):
http://docs.python.org/library/stdtypes.html#str.replace

Cheers,
Chris
--
http://blog.rebertia.com
--
http://mail.python.org/mailman/listinfo/python-list