how to remove the punctuation and no need words from paragraphs

Discussion in 'Python' started by kylin, Nov 3, 2009.

  1. kylin

    kylin Guest

    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.
    kylin, Nov 3, 2009
    #1
    1. Advertising

  2. kylin

    Chris Rebert Guest

    On Tue, Nov 3, 2009 at 1:44 PM, kylin <> 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
    Chris Rebert, Nov 4, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dfhLASST

    Remove punctuation from String?

    dfhLASST, Nov 11, 2004, in forum: Java
    Replies:
    4
    Views:
    55,344
    Woebegone
    Nov 11, 2004
  2. jersie0
    Replies:
    0
    Views:
    682
    jersie0
    Nov 23, 2003
  3. Tashfeen Bhimdi
    Replies:
    6
    Views:
    2,642
    Alf P. Steinbach
    Oct 11, 2006
  4. BerlinBrown
    Replies:
    6
    Views:
    4,481
  5. Max Norman
    Replies:
    6
    Views:
    184
    Max Norman
    Jul 22, 2009
Loading...

Share This Page