Skip to main content
If your work is focused on general software development—building applications, writing production code, and managing large code bases—the AWS SageMaker Code Editor (managed VS Code) is generally a better fit. For exploratory workflows—data analysis, iterative visualization, experiment annotation, and fast prototyping—JupyterLab and Jupyter Notebooks remain the best choice.
A dark presentation slide titled "Solution: JupyterLab" showing four labeled boxes: Data analysis, Exploratory data science, Interactive visualization, and Notebook-based development. A small "© Copyright KodeKloud" notice appears in the lower-left corner.
Creating a Code Editor space To create a Code Editor space in SageMaker Studio, open the Applications panel and find the Code Editor application. Creating a space provisions a managed Amazon EC2 instance and launches an instance of Visual Studio Code inside a container. When provisioning you must provide a name for the space (for example, “My Code Editor Space”). When the Code Editor space is provisioned you can inspect:
  • the EC2 instance type (CPU/memory),
  • the container image used,
  • and the attached storage size.
Once the space state is Running, click Open Code Editor to launch the VS Code environment. The interface behaves like standard Visual Studio Code: a left activity bar for files and extensions, a central editor area with tabs, and full support for debugging and version control.
A screenshot of a code editor provisioning interface titled "Workflow: Provisioning Code Editor Space." It shows a codespace named "codespace1" with instance ml.t3.medium, a SageMaker image selection, and space settings (5 GB storage).
Key provisioning details Debugging and running scripts One of the primary benefits of the Code Editor is the built-in debugger. You can set breakpoints, step line-by-line, inspect variables, and trace exceptions—capabilities that make debugging production-style scripts far easier than in many notebook environments. Below is a concise, corrected example script that downloads a CSV from S3, preprocesses the data, and uploads the processed file back to S3. This example includes the required imports, an initialized S3 client, and robust handling for numeric-only median imputation and scaling.
If you invoke the script without required CLI arguments, argparse will print a usage message and exit:
When debugging in VS Code, set breakpoints (for example, inside process_data), step into functions, and inspect variables like the DataFrame and the StandardScaler instance. This lets you reproduce and fix runtime exceptions that can be difficult to debug in notebook cells. Note: VS Code supports notebooks, but its notebook experience typically lacks some of JupyterLab’s richer interactive visualization and exploratory tools. For interactive visual exploration, JupyterLab is usually superior. Here is a small example demonstrating raw tabular data with missing values loaded into pandas:
Typical pandas output will represent missing numeric values as NaN: Bedrooms Price Neighborhood 0 2.0 200000.0 Downtown 1 3.0 250000.0 NaN 2 4.0 NaN Suburb 3 NaN 150000.0 Rural Why choose Code Editor vs JupyterLab Use the Code Editor when your workflow emphasizes software engineering practices, productionization, and automation. Use JupyterLab for interactive exploration and visualization.
Hybrid workflow recommendation: start with Jupyter Notebooks for exploration and prototyping, then refactor stable, reusable logic into modules and scripts in the Code Editor for productionization, testing, and automation.
A presentation slide titled "Results: Productivity Gains" listing three numbered recommendations: use JupyterLab for early-stage exploration, transition to Code Editor for structured development, and use SageMaker Pipelines for custom processing jobs. The items are shown as horizontal colored bars on a dark blue background.
When to refactor into scripts As projects mature, move exploratory logic into well-tested, maintainable code:
  • Extract reusable functions and modules from notebooks.
  • Add robust error handling, input validation, and structured logging.
  • Introduce unit tests and consider type hints for clearer interfaces.
  • Use the Code Editor to refactor, debug, and integrate code into automation pipelines (SageMaker Pipelines, Step Functions, or Airflow).
A presentation slide titled "Summary" listing four points: Code Editor is an alternative IDE within SageMaker Studio, ideal for VSCode users, offers better debugging than JupyterLab, and is best for general code development.
Summary
  • The Code Editor in AWS SageMaker Studio provides a managed VS Code environment ideal for application development, refactoring, and building automation.
  • JupyterLab remains the go-to environment for exploratory data analysis and interactive visualization.
  • A hybrid approach is common: notebooks for experimentation, then refactor to scripts and develop in an IDE for production.
  • For automation (SageMaker Pipelines, Step Functions, Apache Airflow), develop and test robust scripts in the Code Editor and integrate them into your CI/CD and MLOps workflows.
A presentation slide titled "Summary" with three numbered points. It outlines using Jupyter alongside a code editor, a hybrid approach for early development and deployment refactoring, and refactoring code into Python scripts for automation with SageMaker Pipelines, AWS Step Functions, or Apache Airflow.
Further reading and references This wraps up the lesson. A brief discussion of SageMaker Studio Classic—what it is and why it is no longer the preferred environment—is provided in a separate module.

Watch Video