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
select a.fips, b.zipcode, count_n, cities, p_50_sqft, p_50_estval | |
from ( | |
select fips, zipcode, cast(sum(n) as unsigned) count_n -- cast to int, otherwise decimal | |
from feature_fips_zips_counts | |
where fips = '48453' | |
and sfr=1 | |
group by 1,2 | |
) a | |
left join feature_tax_zipcode_city b | |
on a.zipcode=b.zipcode |
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
export PS1="\T \[\033[36m\]\u\[\033[m\] @ \[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
alias ll='ls -lahG' |
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 numpy as np | |
import pandas as pd | |
from sklearn.pipeline import Pipeline | |
from sklearn.preprocessing import StandardScaler, Binarizer | |
from sklearn.base import TransformerMixin, BaseEstimator | |
""" | |
PyData Chicago |
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
SitusAddress, | |
SitusCity, | |
SitusState, | |
SitusZip, | |
SitusZip4, | |
SitusCounty, | |
SitusStateCountyFIPS, | |
PropertyType, | |
PropertyZoning, | |
PropertyGroup, |
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
# empty dictionary for storing DataFrames | |
results = {} | |
# list of params for query | |
my_list = ['MX19', 'MX20', 'MX21', 'MX22', 'MX23', 'MX24', 'MX25', 'MX26', 'MX27', 'MX28', 'MX29', 'MX30', 'MX31', 'MX32'] | |
for x in my_list: | |
ADM = """ | |
SELECT a.SQLDATE, |
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
# To select rows whose column value equals a scalar, some_value, use ==: | |
df.loc[df['column_name'] == some_value] | |
# To select rows whose column value is in an iterable, some_values, use isin: | |
df.loc[df['column_name'].isin(some_values)] | |
# Combine multiple conditions with &: |
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
update tableA a | |
inner join tableB b | |
on a.RTPropertyUniqueIdentifier=b.RTPropertyUniqueIdentifier | |
SET a.fips=b.SitusStateCountyFIPS, | |
a.col2=b.col2; | |
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
General Purpose - Current Generation | |
| vCPU | ECU | Memory (GiB) | Instance Storage (GB) | Linux/UNIX Usage | | |
============|======|==========|==============|=======================|==================|========== | |
t2.nano | 1 | Variable | 0.5 | EBS Only | $0.0058 | per Hour | |
t2.micro | 1 | Variable | 1 | EBS Only | $0.0116 | per Hour | |
t2.small | 1 | Variable | 2 | EBS Only | $0.023 | per Hour | |
t2.medium | 2 | Variable | 4 | EBS Only | $0.0464 | per Hour | |
t2.large | 2 | Variable | 8 | EBS Only | $0.0928 | per Hour | |
t2.xlarge | 4 | Variable | 16 | EBS Only | $0.1856 | per Hour |
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
sudo apt-get update # Fetches the list of available updates | |
sudo apt-get upgrade # Strictly upgrades the current packages | |
sudo apt-get dist-upgrade # Installs updates (new ones) |
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
SELECT | |
table_schema, | |
table_name, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`, | |
sum(table_rows) Rows | |
FROM information_schema.TABLES | |
WHERE table_schema='paretodb' | |
GROUP BY 1,2 | |
ORDER BY (data_length + index_length) DESC | |
LIMIT 100 |
NewerOlder