Overview
PXL (Probably Expression Language) is a focused language with six core functions for data analysis: filter, extract, classify, score, ntile, and word_count.
Intelligent Expression Language
PXL combines the precision of code with the simplicity of natural language. Write expressions that feel natural while leveraging the full power of AI-assisted data analysis.
What is PXL?
Section titled “What is PXL?”Core Concept
Section titled “Core Concept”PXL provides six essential functions for data analysis:
- filter: Apply conditional filters to data
- extract: Use AI to extract themes and concepts from text
- classify: Categorize text into defined groups
- score: Rate text along semantic scales
- ntile: Create statistical buckets from numeric data
- word_count: Count words in text fields
Design Goals
Section titled “Design Goals”PXL is designed to be:
- Simple: Six functions cover most data analysis needs
- Readable: Functions use natural language descriptions
- AI-Powered: Text functions leverage machine learning
- Focused: Built specifically for analytical workflows
PXL in Action
Section titled “PXL in Action”Basic Filtering
Section titled “Basic Filtering”filter(revenue > 1000 and status = "active")AI-Powered Classification
Section titled “AI-Powered Classification”classify(customer_feedback into ("positive", "negative", "neutral"))Function Combination
Section titled “Function Combination”filter(amount > 500)extract("sentiment" from review_text)score(review_text from "negative" to "positive")Key Features
Section titled “Key Features”AI-Powered Functions
Section titled “AI-Powered Functions”Text Analysis Functions
- extract: Uses AI clustering to identify themes in text
- classify: AI-powered categorization into defined groups
- score: Semantic rating along specified scales
- Natural language descriptions in function parameters
Built-in Intelligence
Section titled “Built-in Intelligence”Available Functions
// Filter data based on conditionsfilter(column_name > value and other_column = "text")
// Extract information using AIextract("what to extract" from text_column)
// Classify data into categoriesclassify(text_column into ("category1", "category2", "category3"))
// Score text between two conceptsscore(text_column from "negative" to "positive")
// Statistical bucketingntile(numeric_column, 4)
// Count words in textword_count(text_column)Function Usage
Section titled “Function Usage”Individual Functions Each PXL function operates on data independently:
filter(status = "active")classify(feedback into ("positive", "negative"))score(feedback from "bad" to "good")Use Cases and Applications
Section titled “Use Cases and Applications”Text Analysis and Classification
Section titled “Text Analysis and Classification”Semantic Operations
- Extract: Pull specific information from text using AI
- Classify: Categorize text into predefined groups
- Score: Rate text on semantic scales
- Filter: Apply AI-powered filtering criteria
Example
extract("customer sentiment" from review_text) ->classify(review_text into ("complaint", "praise", "question")) ->score(review_text from "negative" to "positive")Data Quantification
Section titled “Data Quantification”Statistical Bucketing
ntile(revenue, 5) // Split into 5 revenue tiersword_count(description) // Count words in textFiltering Examples
filter(amount > 1000 and status = "active")filter(category in ("A", "B", "C"))filter(date after "2023-01-01")Performance Features
Section titled “Performance Features”Execution
Section titled “Execution”DuckDB Integration
- Functions execute using DuckDB’s query engine
- Columnar processing for analytical workloads
- Automatic parallelization for larger datasets
- Memory-efficient processing
AI Function Optimization
Section titled “AI Function Optimization”- Text functions use clustering to reduce API calls
- Caching of similar text analysis results
- Efficient batching for large text datasets
Integration with Probably
Section titled “Integration with Probably”Spreadsheet Interface
Section titled “Spreadsheet Interface”Expression Bar
- Type PXL expressions in the formula bar
- Apply functions to create new columns
- View function results in spreadsheet
- Error messages for invalid syntax
AI Agent Usage
Section titled “AI Agent Usage”Question-Based Analysis
- Ask questions that use PXL functions behind the scenes
- Agent automatically applies appropriate functions
- Text analysis through natural language queries
- Filter and analyze data through conversation
Working with PXL
Section titled “Working with PXL”Basic Workflow
Section titled “Basic Workflow”- Identify Analysis Need: Determine what function to use
- Write Expression: Use appropriate PXL function
- Apply to Data: Execute function on dataset
- Review Results: Check output and refine if needed
Best Practices
Section titled “Best Practices”Function Usage
// Use descriptive text in AI functionsextract("customer sentiment" from review_text)classify(feedback into ("complaint", "praise", "question"))score(review_text from "very negative" to "very positive")
// Filter data efficientlyfilter(status = "active" and amount > 1000)Effective Analysis
- Use specific descriptions in text functions
- Filter data to focus analysis
- Check results and refine function parameters
- Combine different function types as needed
What’s Next?
Section titled “What’s Next?”Built-in Functions
Explore the comprehensive library of built-in functions and operations.
Advanced Techniques
Master advanced patterns, optimization, and complex analysis workflows.