Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 2.73 KB

quick-start.md

File metadata and controls

86 lines (66 loc) · 2.73 KB

Quick Start

Basic Features and Syntax Example

  1. Loading Data

    LOAD "data.csv" INTO dataset;
    
    • Explanation: Loads data from a CSV file named data.csv into a variable named dataset.
  2. Summarizing Data

    SUMMARIZE dataset;
    
    • Explanation: Provides a summary (statistics) of the dataset stored in the dataset variable.
  3. Filtering Data

    FILTER dataset WHERE age > 30 INTO filtered_data;
    
    • Explanation: Filters records in dataset where the age column is greater than 30 and stores the filtered result in filtered_data.
  4. Grouping Data

    GROUP dataset BY category INTO grouped_data;
    
    • Explanation: Groups data in dataset by the category column and stores the grouped result in grouped_data.
  5. Custom Functions

    DEFINE FUNCTION mean(list) {
        SUM = 0;
        COUNT = 0;
        FOR EACH value IN list {
            SUM = SUM + value;
            COUNT = COUNT + 1;
        }
        RETURN SUM / COUNT;
    }
    
    • Explanation: Defines a custom function mean to calculate the mean of a list of numbers.
  6. Plotting Data

    PLOT histogram OF dataset BINS 10;
    
    • Explanation: Generates a histogram plot of the dataset variable with 10 bins.

Implementation Considerations

  • Syntax: Keep the syntax simple and intuitive, resembling natural language where possible.
  • Data Types: Support a variety of data types such as integers, floats, strings, dates, lists, and dictionaries.
  • Operations: Provide built-in functions and operators for common data operations like arithmetic, comparisons, and string manipulations.
  • Customization: Allow users to define custom functions and handle complex data manipulations.

Example Usage

LOAD "data.csv" INTO dataset;
SUMMARIZE dataset;
FILTER dataset WHERE age > 30 INTO older_people;
GROUP dataset BY category INTO categories;
DEFINE FUNCTION mean(list) {
    SUM = 0;
    COUNT = 0;
    FOR EACH value IN list {
        SUM = SUM + value;
        COUNT = COUNT + 1;
    }
    RETURN SUM / COUNT;
}
PLOT histogram OF dataset BINS 10;

Notes

  • This example provides a basic framework for a data scripting language focused on ease of use and effectiveness.
  • Depending on your specific requirements, you may need to expand upon these features, handle more complex data structures, and integrate with external libraries or APIs for advanced functionality.
  • Designing such a language involves balancing simplicity with versatility, ensuring that users can perform powerful data manipulations without unnecessary complexity.