Skip to main content

How to Create Dataset using Server Script

What is Server Script?

  • Server-side scripting is involves employing scripts on a server which produces a response customized for each user's request to the website.

I. Create Dataset using Server Script :-

  1. Follow this procedure to create dataset. (Note: Follow the steps till No. 4 for this example)

  2. Update the Details as given below:

  • Name: ss_table
  • Datasource: Empty Dataset
  • Server Script: Check the checkbox
  • Language: Select Python3 from the drop-down list.

Docusaurus Slash Introduction

  1. Go to Server Script Tab & paste your script. (For this example, you can use refer note)
Note:

dict = {"country": ["Brazil", "Russia", "India", "China", "South Africa"],
"capital": ["Brasilia", "Moscow", "New Dehli", "Beijing", "Pretoria"],
"area": [8.516, 17.10, 3.286, 9.597, 1.221],
"population": [200.4, 143.5, 1252, 1357, 52.98] }

import pandas as pd
brics = pd.DataFrame(dict)
data = {'data':brics.to_json(orient = 'records')};
display(data);

Docusaurus Slash Introduction

  1. Click on preview button & your window will look as per image below:

    Docusaurus Slash Introduction

  2. Click on Submit button to create dataset.