Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,673 members, 7,801,942 topics. Date: Friday, 19 April 2024 at 06:34 AM

Python: TUPLES - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python: TUPLES (1034 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)

Add A Dictionary To A Grid / Learn Programming Very Fast And Stress Free / Who Knows About This App "WORLDREMIT?

(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 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.