Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,713,248 members, 6,410,030 topics. Date: Wednesday, 28 July 2021 at 10:34 PM

Python: TUPLES - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python: TUPLES (925 Views)

Practical Introduction To Python Web Programming / Python Smtp Scanner / Mastering Python - Networking And Security Training Video (2) (3) (4)

(1) (Reply)

Python: TUPLES by UncleJJ(m): 5:34am On May 15, 2016
this is my code


import pandas as pd
import nltk
import wordsegment
from wordsegment import segment
from nltk import pos_tag, word_tokenize

def readdata():
datafileread = pd.read_csv('data.net.lint.csv')
domain_names = datafileread.DOMAIN[0:5]

for domain_name in domain_names:
seg_words = segment(domain_name)
postagged = nltk.pos_tag(seg_words)
limit_names = postagged
for keys,values in postagged:





readdata()




I am trying to get get the values from the tuples nltk produces but I get this instead
['NN']
['NN']
['PRP']
['RP']
['JJ']
['NN']
['NNS']
['VB']
['NN']

Some values should be on a line and not a new line.

Who can help please.

(1) (Reply)

Signup With Facebook And Win A Macbook From BGR / Is There Anybody Using. adf. ly.com On Your Blog? / Pls Pal I Need Help With Dis Php Server Problem

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2021 Oluwaseun Osewa. All rights reserved. See How To Advertise. 28
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.