Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load required pacakges | |
if(!require("readtext")) | |
install.packages("readtext") | |
library(readtext) | |
if(!require("tm")) | |
install.packages("tm") | |
library(tm) | |
if(!require("stringr")) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load required pacakges | |
if(!require("readtext")) | |
install.packages("readtext") | |
library(readtext) | |
if(!require("tm")) | |
install.packages("tm") | |
library(tm) | |
if(!require("stringr")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
#reading text into python | |
path = "~/textCourpus.txt" | |
f = open(path,'r') | |
lines = [line.replace('\n','') for line in f.readlines()] | |
#lines2 = [line.replace('\n','') for line in f.readlines()] | |
type(lines) | |
len(lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(pca) | |
data("crimtab") #load data | |
head(crimtab) #show sample data | |
dim(crimtab) #check dimensions | |
str(crimtab) #show structure of the data | |
sum(crimtab) | |
colnames(crimtab) | |
apply(crimtab,2,var) #check the variance accross the variables | |
pca =prcomp(crimtab) #applying principal component analysis on crimtab data | |
par(mar = rep(2, 4)) #plot to show variable importance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import numpy | |
import scipy.stats | |
import seaborn | |
import matplotlib.pyplot as plt | |
# any additional libraries would be imported here | |
data = pandas.read_csv('C:\\Suresh\\Blog Posts\\datasets\\nesarc_pds1134\\SPLITDATA\\CourseData.csv', low_memory=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mean of the rows | |
apply(m, 1, mean) | |
# mean of the columns | |
apply(m, 2, mean) | |
# divide all values by 2 | |
apply(m, 1:2, function(x) x/2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>HTML UI</h1> | |
<table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(twitteR) | |
library(tm) | |
library(stringr) | |
library(wordcloud) | |
#fetch data | |
load("D:/Suresh R&D/Emirates Airlines SNA/twitteR_credentials") | |
registerTwitterOAuth(twitCred) | |
tweets = searchTwitter("@emirates", lang="en",cainfo="D:/Suresh R&D/Emirates Airlines SNA/cacert.pem") | |
#remove retweets |
NewerOlder