Code | Title | Duration | Link |
---|---|---|---|
Keynote | Andy Jassy Keynote Announcement Recap | 0:01 | https://www.youtube.com/watch?v=TZCxKAM2GtQ |
Keynote | AWS re:Invent 2016 Keynote: Andy Jassy | 2:22 | https://www.youtube.com/watch?v=8RrbUyw9uSg |
Keynote | AWS re:Invent 2016 Keynote: Werner Vogels | 2:16 | https://www.youtube.com/watch?v=ZDScBNahsL4 |
Keynote | [Tuesday Night Live with Jame |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pyathena | |
import pandas as pd | |
## Directly by panda | |
athena_conn = pyathena.connect(aws_access_key_id=os.environ['ATHENA_USER'], ##credentials of aws_access_key_id | |
aws_secret_access_key=os.environ['ATHENA_PASSWORD'], ##credentials of aws_secret_access_key | |
s3_staging_dir='s3://aws-athena-query-results-<your-details>', ##where the athena query result saved - checked in S3 , | |
region_name='eu-west-1') ##the region you set for Athena | |
df = pd.read_sql("SELECT * FROM tutorial.wbcdata LIMIT 10", athena_conn) |
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
{ | |
"Header": { | |
"prefix": "header", | |
"body": [ | |
"'''", | |
"#FILE: $1", | |
"Project: $WORKSPACE_NAME", | |
"-------------------", | |
"By: Anh Dang", | |
"Date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE", |
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
-- Search for a columns in DB | |
SELECT COLUMN_NAME AS "ColumnName", | |
TABLE_NAME AS "TableName", | |
TABLE_SCHEMA | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME LIKE 'cashfac_id' | |
ORDER BY TABLE_NAME, | |
COLUMN_NAME; | |
-- List all columns one table |
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
## Tuple: | |
# Capture arbitrarily long list | |
values = 1,2,3,4,5 | |
a, b, *rest = values | |
# Discard the rest | |
a, b, *_ = values | |
## Zip: | |
# "pairs" up the elements of list | |
seq1 = ['foo','bar','baz'] |
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
# Categorizing to dicts | |
words = ['apple', 'bat', 'bar', 'atom', 'book'] | |
by_letters = {} | |
for word in words: | |
letter = word[0] | |
by_letters[letter] = by_letters.get(letter, 0) + 1 | |
value = by_letters[letter] | |
print('Letter: {} - Count: {}'.format(letter, value)) |
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
## Tuple: | |
# Capture arbitrarily long list | |
values = 1,2,3,4,5 | |
a, b, *rest = values | |
# Discard the rest | |
a, b, *_ = values | |
## Zip: | |
# "pairs" up the elements of list | |
seq1 = ['foo','bar','baz'] |
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
## Functions ----------- | |
## Multiple return | |
def f(): | |
a = 5 | |
b = 6 | |
c = 7 | |
return a, b, c | |
a, b, c = f() |
OlderNewer