Question: CONVERT R TO PYTHON: # Load the data sets data.small

CONVERT R TO PYTHON: # Load the data sets data.small <- read.csv("data/bb/bb_2011_2013.csv", stringsAsFactors = FALSE) data <- read.csv("data/bb/bb_1996_2013.csv", stringsAsFactors = FALSE) # Load generic and domain-specific sentiment lexicons # positive.lexicon.files and negative.lexicon.files contain a list of files # with positive and negative lexicons respectively.  positive.lexicon.files <- c( "data/lexicons/lexicon.generic.positive.HuLiu.csv", "data/lexicons/lexicon.finance.positive.LoughranMcDonald.csv", "data/lexicons/lexicon.finance.positive.csv" ) negative.lexicon.files <- c( "data/lexicons/lexicon.generic.negative.HuLiu.csv", "data/lexicons/lexicon.finance.negative.LoughranMcDonald.csv", "data/lexicons/lexicon.finance.negative.csv" ) # Iterate over each file, read the contents and store them as a matrix # The contents of each file will be stored rowwise in pos.lexicon (see rbind()) # Convert pos.lexicon to a vector (see as()), convert all the words to lower case # and remove duplicate words (see unique()). Repeat the proecess for neg.lexico pos.lexicon <- c() neg.lexicon <- c()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!