Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created May 22, 2020 14:04
Show Gist options
  • Save aravindpai/86be1b66f092ea919bb0ea4c3ffedea7 to your computer and use it in GitHub Desktop.
Save aravindpai/86be1b66f092ea919bb0ea4c3ffedea7 to your computer and use it in GitHub Desktop.
#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