Skip to content

Instantly share code, notes, and snippets.

{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket"
},
"DataAnalysisLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
@qtangs
qtangs / serverless.yaml
Last active December 9, 2018 15:19
sample-service's serverless configuration file
service: sample-service # Name of the service, which is used as a prefix to all function names. TODO: Update to your custom name.
frameworkVersion: ">=1.34.0" # Layers are supported from version 1.34
provider:
name: aws # Assuming this is for AWS Lambda.
stage: dev # Name of the stage, typically either dev/staging/prod (or production), this is also added to all function names. TODO: Update to your custom name.
profile: some-aws-profile # Name of the pre-configured AWS profile that is founnd in ~/.aws/confidentials. TODO: Update to your profile.
region: some-region # Name of the region to deploy all functions to. TODO: Update to your custom region.
runtime: python3.6 # AWS Lambda runtime
import numpy as np
import pandas as pd
def handler(event, context):
dates = pd.date_range('20181201', periods=6)
df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
print(df)
START RequestId: 2cee0f93-f97c-11e8-be81-1d3426460e67 Version: $LATEST
A B C D
2018-12-01 0.837058 -0.997650 0.333986 -0.266099
2018-12-02 -1.824489 0.306344 2.331290 0.520816
2018-12-03 1.605077 -1.516653 0.161290 0.163109
2018-12-04 0.740779 0.481298 -0.111764 -0.548484
2018-12-05 0.861482 0.630950 -0.588095 -2.114341
2018-12-06 -0.511081 -0.181257 0.068638 -1.685518
END RequestId: 2cee0f93-f97c-11e8-be81-1d3426460e67
REPORT RequestId: 2cee0f93-f97c-11e8-be81-1d3426460e67 Duration: 297.16 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 90 MB
@qtangs
qtangs / requirements.txt
Created December 5, 2018 16:52
Requirements for Pandas v0.23 Layer
pandas==0.23.4
pytz==2018.7