A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| // Start Express | |
| const express = require("express"); | |
| const app = express(); | |
| // Set the view directory to /views | |
| app.set("views", __dirname + "/views"); | |
| // Let's use the Pug templating language | |
| app.set("view engine", "pug"); |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| import nltk | |
| import string | |
| import re | |
| from nltk.stem.snowball import SnowballStemmer | |
| stopwords=nltk.corpus.stopwords.words('english') | |
| snowball_stemmer=SnowballStemmer(language='english') | |
| def treat_text(text): | |
| edited_text=re.sub('\W'," ",text) #replace any sumbol with whitespace |