Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created May 22, 2020 14:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#importing library
import pandas as pd
#reading .txt file
text = pd.read_csv("sample.txt",header=None)
#converting a dataframe into a single list
corpus=[]
for row in text.values:
tokens = row[0].split(" ")
for token in tokens:
corpus.append(token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment