# Max index of train data | |
train_ind = round(stocks_close.shape[0] * 0.7) | |
# Function for optimization | |
def evaluate_renko(brick, history, column_name): | |
renko_obj = pyrenko.renko() | |
renko_obj.set_brick_size(brick_size = brick, auto = False) | |
renko_obj.build_history(prices = history) | |
return renko_obj.evaluate()[column_name] |
If you deployed your app to AWS Lambda with scss, you most got an error saying the node-sass bindings are missing.
Missing binding /opt/nodejs/node_modules/node-sass/vendor/linux-x64-64/binding.node\nNode Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x\n\nFound bindings for the following environments:\n - OS X 64-bit with Node.js 12.x\n\nThis usually happens because your environment has changed since running
npm install
.\nRunnpm rebuild node-sass
to download the binding for your current environment.
AWS Lambda requires linux-x64-64_binding.node. If you're coding on macOs or Windows, you won't have it. So here's the command to include in your deployment script.

AWSTemplateFormatVersion: "2010-09-09" | |
Transform: AWS::Serverless-2016-10-31 | |
Globals: | |
Function: | |
Timeout: 60 | |
Parameters: | |
Stage: | |
Type: String |
This shows how to convert a basic REST ApiGateway template to its equivalent HTTP ApiGatewayV2.
The original code before refactoring to ApiGatewayV2 comes from this article
Replace MY_PROFILE
, MY_REGION
and MY_STACK_NAME
AWSTemplateFormatVersion: '2010-09-09' | |
Description: AWS API Gateway with a Lambda Integration | |
Parameters: | |
lambdaFunctionName: | |
Type: "String" | |
AllowedPattern: "^[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9]+$" | |
Description: Lambda function name. (Recommend to keep default) | |
Default: "lambda-api" |