We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains 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
Login email;Identifier;First name;Last name | |
laura@example.com;2070;Laura;Grey | |
craig@example.com;4081;Craig;Johnson | |
mary@example.com;9346;Mary;Jenkins | |
jamie@example.com;5079;Jamie;Smith |
This file contains 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 spacy | |
# Load the English model | |
nlp = spacy.load("en_core_web_sm") | |
def lemmatize_text(text): | |
# Process the text | |
doc = nlp(text) | |
# Extract the lemmas |
This file contains 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 | |
from nltk.stem import WordNetLemmatizer | |
# Initialize the lemmatizer | |
lemmatizer = WordNetLemmatizer() | |
def lemmatize_text(text): | |
# Tokenize the text | |
tokens = nltk.word_tokenize(text) |
This file contains 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 | |
from nltk.corpus import stopwords | |
# Load the stop words | |
stop_words = set(stopwords.words('english')) | |
def remove_stop_words(text): | |
# Tokenize the text | |
tokens = nltk.word_tokenize(text) |
This file contains 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
def remove_stop_words(text): | |
# Split the text into words | |
words = text.split() | |
# Define the stop words | |
stop_words = ['a', 'an', 'and', 'the', 'in', 'of'] | |
# Remove stop words | |
clean_words = [word for word in words if word not in stop_words] |
This file contains 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 re | |
def clean_text(text): | |
# Use a regular expression to remove punctuation and special characters | |
clean_text = re.sub(r'[^\w\s]', '', text) | |
# Remove leading and trailing whitespace | |
clean_text = clean_text.strip() | |
return clean_text |
This file contains 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 string | |
def clean_text(text): | |
# Create a translation table to remove punctuation and special characters we are replacing space. | |
translator = str.maketrans('', '', string.punctuation + string.printable.replace(' ','')[62:]) | |
# Use the translate method to remove the characters | |
clean_text = text.translate(translator) |
This file contains 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
@app.callback(Output('km-travelled-gauge', 'value'), Input('km-travelled-slider', 'value')) | |
def km_travelled_update(km_travelled): | |
return km_travelled | |
@app.callback(Output('km-per-liters-slider-output', 'value'), Input('km-per-liters-slider', 'value')) | |
def km_travelled_update(km_per_lit): | |
return km_per_lit | |
@app.callback(Output('engine-size-slider-output', 'value'), Input('engine-size-slider', 'value')) | |
def km_travelled_update(engine_slider): |
NewerOlder