MacOS:
-
$
brew services stop mysql
-
$
brew services list
-
$
brew uninstall mysql
-
$
brew install mysql
-
$
brew postinstall mysql
If Any error found then run those cmd
- $
sudo rm -rf /usr/local/var/mysql
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
from sklearn.model_selection import train_test_split | |
from scipy import stats | |
def train_validate_test_split(df, target, seed=123): | |
''' | |
This function takes in a dataframe, the name of the target variable |
exam_score | hours_studied | study_strategy | handedness | coffee_consumed | hours_slept | |
---|---|---|---|---|---|---|
100.59101129985446 | 9.126291029886985 | flashcards | left | 0 | 11 | |
95.63708565196075 | 9.677437978787804 | flashcards | left | 1 | 10 | |
53.20029575279457 | 4.5502066553150184 | NA | right | 5 | 6 | |
63.9342682639801 | 6.48784774924302 | flashcards | right | 4 | 7 | |
51.186370191249075 | 6.720959153667016 | flashcards | right | 5 | 6 | |
99.62859279285587 | 5.887576815759884 | NA | left | 1 | 10 | |
10.427946120088633 | 1.2757594563672985 | NA | left | 9 | 2 | |
65.71187651647034 | 4.660530100027061 | NA | right | 4 | 7 | |
66.4234146158894 | 10.040814212451718 | flashcards | right | 4 | 7 |
id,customer_id,gender,is_senior_citizen,partner,dependents,phone_service,internet_service,contract_int,payment_type,monthly_charges,total_charges,churn,tenure_month,has_churned,has_phone,has_internet,has_internet_and_phone,partner_dependents,start_day,phone_type,internet_type,contract_type | |
0,0002-ORFBO,Female,0,Yes,Yes,1,1,1,Mailed check,65.6,593.3,No,9.0,False,True,True,True,3,2020-05-03,One Line,DSL,1 Year | |
1,0003-MKNFE,Male,0,No,No,2,1,0,Mailed check,59.9,542.4,No,9.1,False,True,True,True,0,2020-05-03,Two or More Lines,DSL,Month-to-Month | |
2,0004-TLHLJ,Male,0,No,No,1,2,0,Electronic check,73.9,280.85,Yes,3.8,True,True,True,True,0,2020-11-03,One Line,Fiber Optic,Month-to-Month | |
3,0011-IGKFF,Male,1,Yes,No,1,2,0,Electronic check,98.0,1237.85,Yes,12.6,True,True,True,True,1,2020-02-03,One Line,Fiber Optic,Month-to-Month | |
4,0013-EXCHZ,Female,1,Yes,No,1,2,0,Mailed check,83.9,267.4,Yes,3.2,True,True,True,True,1,2020-11-03,One Line,Fiber Optic,Month-to-Month | |
5,0013-MHZWF,Female,0,No,Yes,1,1,0,Credit card (automatic),69.4 |
MacOS:
$ brew services stop mysql
$ brew services list
$ brew uninstall mysql
$ brew install mysql
$ brew postinstall mysql
If Any error found then run those cmd
sudo rm -rf /usr/local/var/mysql
Run the following command on your terminal to install Homebrew. Homebrew is a package manager for Macs and is used to install useful development tools and software.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install --cask anaconda
to install Anacondadrinks = [
{
"type": "water",
"calories": 0,
"number_consumed": 5
},
{
"type": "orange juice",
"calories": 220,
Write the code that operates on a single string containing the make and model of a vehicle. The first part of the string before the space is the make The last part of the string after the space is the model We can assume that the strings will only have one space. Assume the input string is completely lower-cased.
Example inputs:
# Prompt the user to enter a number until they enter 5 | |
while True: | |
# Obtain user input | |
number = input("Please input the number 5: ") | |
# Check if the input string is a digit | |
if number.isdigit(): | |
# Now that we know the input is a digit, we can make sure to turn that string containing the number into an integer. |
def is_prime(num): | |
""" | |
Returns a boolean if the input argument is a prime number or not. | |
""" | |
if type(num) != int: | |
return False | |
if num <= 0: | |
return False | |
if num == 1: | |
return True |
# Following up on https://github.com/mwaskom/seaborn/issues/1027 and https://stackoverflow.com/questions/34615854/seaborn-countplot-with-normalized-y-axis-per-group | |
import pandas as pd | |
import seaborn as sns | |
def category_percentages_by_another_category(df, category_a, category_b): | |
(df.groupby(category_b)[category_a].value_counts(normalize=True) | |
.rename('percent') | |
.reset_index() | |
.pipe((sns.catplot, 'data'), x=category_a, y='percent', hue=category_b, kind='bar')) |