String Matching a list of names

I’m working on my first big project trying to learn more about string matching. I am trying to match a list of names based on this article: https://bergvca.github.io/2017/10/14/super-fast-string-matching.html import pandas as pd import re from sklearn.feature_extraction.text import TfidfVectorizer names_short = pd.DataFrame([“gogle”,”bing”,”amazn”,”facebook”,”fcbook”,”abbasasdfzz”, “zsdfzl”,”gogle”,”bing”,”amazn”,”facebook”,”fcbook”, “abbasasdfzz”,”zsdfzl”,”google”,”bing”,”amazon”,”facebook”], columns=[“name”]) def ngrams(string, n=3): string = re.sub(r'[,-./]|\sBD’,r”, string) ngrams = zip(*[string[i:] for…

Details

Not able to open terminal in MacOS while running .sh files with child_process

The following snippet of code opens Git bash and runs the shell commands in Windows. But in MacOS, it doesn’t open the terminal for the same. Shell script is not being run. const exec = require(‘child_process’).exec; var str = “test.sh” const myShellScript = exec(str); myShellScript.stdout.on(‘data’, (data)=>{ console.log(data); }); myShellScript.stderr.on(‘data’, (data)=>{ console.error(data); });

Details

How do I make count return 0 with group by 5 min if no records appear in that group?

Here is my code: select case when count(distinct player) > 0 then count(distinct player) else 0 end as ‘num’, FROM_UNIXTIME(UNIX_TIMESTAMP(Timestamp2) DIV 300) as ‘5m’, GameID from table_4 where Timestamp2 between ‘2018-05-01’ and ‘2018-05-02’ group by UNIX_TIMESTAMP(Timestamp2) DIV 300, GameID My data structure looks like: player date GameID 1 2018-05-10 00:00:00 1 2 2018-05-10 00:01:00 2…

Details