title: Aws ParamValidationError: Parameter validation failed: Invalid type for parameter Body, value:
body: <p>I am writing the code in AWS lambda and I cannot pass data
  like
  [0,1,0,0,0,1.....]
  it says parameter validation error any solutions as to how to pass the data?</p>
  <pre><code>import json
  import gspread
  from oauth2client.service_account import ServiceAccountCredentials
  import pandas as pd
  import os
  import io
  import boto3
  import csv
  import numpy as np
  from preprocessing import preproprocess
  ENDPOINT_NAME = os.environ['ENDPOINT_NAME']
  runtime= boto3.client('runtime.sagemaker')
  def lambda_handler(event, context):
      data = json.loads(json.dumps(event))
      payload = data['data']
      print(payload)
      # any_text= 'Hi sarah wondering what is the status of my order thanks soham'
      # order_status='Awaiting shipment'
      # eg= preproprocess(any_text,order_status)
      response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME,
                                        ContentType='text/csv',
                                        Body=payload)
  </code></pre>
  <p>Here is the code to my model</p>
  <pre><code>%%writefile train.py
  import pip
  from pip._internal import main
  def install(package):
      &quot;&quot;&quot;install packages&quot;&quot;&quot;
      if hasattr(pip, 'main'):
          pip.main(['install', package])
      else:
          main(['install', package])
  install('s3fs')
  import os
  import boto3
  import pandas as pd
  from sklearn.svm import SVC
  from sklearn.externals import joblib
  import s3fs
  
  bucket_name  = 'testsvc'
  if __name__ == &quot;__main__&quot;:
      training_data_directory_path = &quot;s3://testsvc/xgboost-as-a-built-in-algo/train/train.csv&quot;
      train_data=pd.read_csv(training_data_directory_path)
      X_train=train_data.drop(columns=['tags'])
      y_train=train_data['tags']
      svc = SVC(kernel = 'rbf',C=10,gamma = 0.1)
      svc.fit(X_train,y_train)
      model_output_directory = os.path.join(&quot;/opt/ml/model&quot;, &quot;model.joblib&quot;)
  #     boto3.Session().resource('s3').Bucket(bucket_name).Object(model_output_directory).upload_file('')
      print(&quot;Saving model to {}&quot;.format(model_output_directory))
      joblib.dump(svc, model_output_directory)
  def model_fn(model_dir):
      &quot;&quot;&quot;Deserialized and return fitted model
  
      Note that this should have the same name as the serialized model in the main method
      &quot;&quot;&quot;
      clf = joblib.load(os.path.join(model_dir, &quot;model.joblib&quot;))
      return clf
  </code></pre>
  <p>When I am passing JSON data in test &quot;0,1,0,0,....&quot; I am getting an error that my data is not getting a 2d array it's a 1-d array please try to reshape it. when I am trying to change the formatting of test data there is a parameter validation error. Please help me some way around this thing.</p>