Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Arifin Othman dingaroo

💭
I may be slow to respond.
View GitHub Profile
@dingaroo
dingaroo / getCount.R
Created Nov 26, 2020
#Updated Count Occurrence of word in column in dataframe in #R
View getCount.R
library(stringr)
getCount <- function(data,keyword)
{
wcount <- str_count(unique_notes$NOTES, keyword)
# return(data.frame(wcount))
return(wcount)
}
@dingaroo
dingaroo / myCount.R
Created Nov 26, 2020
Count Occurrence of certain words from a dataframe row in #R
View myCount.R
library(stringr)
getCount <- function(data,keyword)
{
wcount <- str_count(dataset$text, keyword)
return(data.frame(data,wcount))
}
@dingaroo
dingaroo / gist:9dcd2f360b524cb97b18ce3a7ecf469d
Created May 12, 2018 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm
View gist:9dcd2f360b524cb97b18ce3a7ecf469d
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):