Inspect an array
NumPy is imported as np. The seeded arr contains [10, 20, 30, 40, 50].
arrExplore NumPy arrays online and build numerical computing skills. Practice array creation, vector arithmetic, and aggregation before larger Python data-science projects.
Start here
Load a task into the terminal, then press Enter to see the result. Each example works in the introductory session on this page.
NumPy is imported as np. The seeded arr contains [10, 20, 30, 40, 50].
arrRead the shape of the one-dimensional sample array.
arr.shapeUse a zero-based index to select one element.
arr[0]Read elements at indices one through three.
arr[1:4]Add five to every element without changing arr.
arr + 5Add all values in the sample array.
arr.sum()Compute the arithmetic mean.
arr.mean()Generate an array from zero through four.
np.arange(5)No setup needed
Explore NumPy arrays online and build numerical computing skills. Practice array creation, vector arithmetic, and aggregation before larger Python data-science projects.
Start with the short command exercises above. When you are ready for a project, open the linked LabEx lab to work with real tools in an online Linux environment, with step-by-step guidance and immediate feedback.
Keep learning
Build on your NumPy experiments with a structured skill tree. Explore the skills, choose a guided lab, and practice each concept in an online environment.
Practice array creation, indexing, arithmetic, and basic statistics. Continue through the Data Science Skill Tree and use a hosted Python lab for larger numerical tasks.
The introductory exercises are free. Sign in for a complete LabEx environment; session duration and resources depend on your lab and plan.
No local installation is required. Sign in and open the lab in a modern browser. Follow the lab instructions to configure software inside the environment.
This preview supports a limited command set. Sign in and launch the Python lab for more commands, packages and services. Available software and permissions depend on the selected lab.
Follow the Data Science Skill Tree for guided labs and challenges. Practice regularly, inspect command output and ask Labby for help.
Your next step
Continue with real tools, guided labs, and Labby assistance.