Notebook

The Notebook feature lets you write, execute, and visualize code in an interactive environment. Perfect for data analysis, experimentation, and documentation.

Getting Started

Creating a Notebook

  1. Navigate to Notebook in the sidebar
  2. Click New Notebook
  3. Give your notebook a name
  4. Select a runtime (Python, JavaScript, SQL, etc.)
  5. Start writing code

Your First Cell

Notebooks are organized into cells. Each cell can contain code that executes independently:

  1. Click inside the empty cell
  2. Type your code
  3. Press Shift + Enter to execute
  4. See results below the cell

Writing Code

Adding Cells

  • Code cells - Write and execute code
  • Markdown cells - Add documentation, titles, descriptions
  • Query cells - Write SQL queries directly

To add a new cell:

  1. Click the + button at the bottom of your current cell
  2. Select cell type
  3. Start typing

Running Code

Execute code immediately:

  • Press Shift + Enter to run cell and move to next
  • Press Ctrl + Enter to run cell and stay
  • Use keyboard shortcuts shown in the cell toolbar

Supported Languages

  • Python (with popular libraries: pandas, numpy, matplotlib, scikit-learn)
  • JavaScript / Node.js
  • SQL (query your databases)
  • Markdown (documentation)

Visualizing Data

Charts and Graphs

Display data visually using built-in charting:

import matplotlib.pyplot as plt

data = [1, 4, 9, 16, 25]
plt.plot(data)
plt.show()

Tables

Data automatically displays as formatted tables:

import pandas as pd

df = pd.DataFrame({
    'Name': ['Alice', 'Bob'],
    'Score': [95, 87]
})
df

Working with Data

Connecting to Databases

Access your CredVault database clusters:

import credvault

db = credvault.connect(cluster='my-cluster', database='my-db')
results = db.query('SELECT * FROM users')

Importing Files

Upload CSV, JSON, or data files:

  1. Click Upload in the notebook
  2. Select your file
  3. Import data into your notebook
import pandas as pd
df = pd.read_csv('data.csv')

Sharing and Saving

Auto-save

Your notebook saves automatically every 30 seconds.

Sharing with Team

  1. Click Share button (top right)
  2. Select team members
  3. Choose permission level:
    • View - Read-only access
    • Edit - Can modify and run
    • Execute - Can only run, not edit

Exporting

Export your notebook as:

  • PDF - For reports and sharing
  • HTML - Interactive web version
  • Markdown - For documentation

Common Tasks

Data Analysis

Combine code, visualization, and markdown for complete analysis:

# Load data
data = pd.read_csv('sales.csv')

# Analyze
print(f"Total sales: ${data['amount'].sum()}")

# Visualize
data['amount'].plot(kind='bar')
plt.show()

Machine Learning

Train and evaluate models:

from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression

X_train, X_test, y_train, y_test = train_test_split(X, y)
model = LogisticRegression()
model.fit(X_train, y_train)
print(f"Accuracy: {model.score(X_test, y_test)}")

Documentation

Mix code and markdown for reproducible documentation:

# Analysis Report

## Overview
This analysis covers Q1 sales trends.

## Key Findings
- 15% increase in revenue
- New market opportunities identified

Tips and Best Practices

  • One task per notebook - Keep notebooks focused
  • Clear cell names - Add markdown headers for navigation
  • Document assumptions - Use markdown cells to explain logic
  • Test incrementally - Run cells as you develop
  • Clean up output - Remove debugging cells before sharing

Troubleshooting

Cell won't run

  • Check for syntax errors (red underline)
  • Ensure dependencies are installed
  • Try restarting the kernel (⚡ icon)

Need a specific library?

Your notebook has these libraries pre-installed. For others, install directly:

!pip install package-name

Performance is slow

  • Reduce dataset size for testing
  • Use .head() instead of loading full dataset
  • Profile your code to find bottlenecks