Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

how to remove the punctuation and no need words from paragraphs

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


huili.song at gmail

Nov 3, 2009, 1:44 PM

Post #1 of 2 (374 views)
Permalink
how to remove the punctuation and no need words from paragraphs

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


clp2 at rebertia

Nov 3, 2009, 11:42 PM

Post #2 of 2 (344 views)
Permalink
Re: how to remove the punctuation and no need words from paragraphs [In reply to]

On Tue, Nov 3, 2009 at 1:44 PM, kylin <huili.song [at] gmail> 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

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.