Spyder: Your IDE for Data Science Development in Python

Spyder: Your IDE for Data Science Development in Python

by Mark Pedigo Publication date Mar 16, 2026 Reading time estimate 12m basics data-science tools

There are many different integrated development environments (IDEs) to choose from for Python development. One popular option for data-focused work is Spyder, an open-source Python IDE geared toward scientists, engineers, and data analysts. Its name comes from Scientific PYthon Development EnviRonment.

Out of the box, it has powerful plotting, what-if, and profiling capabilities. It also integrates well with the data science ecosystem, is extensible with first- or third-party plugins, and has a relatively quick learning curve.

How does Spyder stack up against other Python IDEs? It depends on your use case. It’s not as powerful or customizable as VS Code, nor does it pretend to be. It does, however, excel for data science workflows:

Use Case Pick Spyder Pick an Alternative
Optimized for data science workflows
Dedicated to Python
Full-featured VS Code
Supports interactive notebooks ✅ With a plugin Jupyter, VS Code

If you’re focused on data science in Python, Spyder is a strong fit. For a more full-featured IDE or heavy notebook use, consider Jupyter or VS Code instead.

You can get a handy Spyder IDE cheat sheet at the link below:

Take the Quiz: Test your knowledge with our interactive “Spyder: Your IDE for Data Science Development in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:


Interactive Quiz

Spyder: Your IDE for Data Science Development in Python

Test your knowledge of the Spyder IDE for Python data science, including its Variable Explorer, Plots pane, and Profiler.

Start Using the Spyder IDE

You can install Spyder in a few ways: as a standalone program, through a prepackaged distribution, or from the command line. You can also try out Spyder online.

To install Spyder as a standalone application, go to the Spyder download page. When you visit the site, it detects your operating system and offers the appropriate download. Once you download your install file, open it and follow the directions.

You can also install a Python distribution tailored to data science, such as Anaconda or WinPython. Both of these choices include Spyder in their base installations.

You’ll likely want to install dependencies and useful data libraries in addition to Spyder. In this case, first create a Python virtual environment, then use this command:

Shell
$ conda create -c conda-forge -n spyder-env spyder numpy scipy pandas matplotlib sympy cython

The install process for pip is similar. To install spyder together with common packages, run:

Shell
$ python -m pip install spyder numpy scipy pandas matplotlib sympy cython

For more information on installing Spyder, refer to their install guide.

Out of the box, the Spyder interface consists of three panes:

Spyder IDE Interface
The Spyder IDE Interface

On the left, you see code in the Editor pane. In the bottom right, you’ll find the IPython Console. Here, you can run code and check past commands using the History tab. The top-right area includes tabs such as Help, Debugger, Files, Find, and Code Analysis. You’ll learn about the Variable Explorer, Plots, and Profiler in the upcoming sections.

Explore Data With the Variable Explorer

The Variable Explorer pane contains details about variables in the current state of execution. It shows information about the type, size, and value of the variables in your program.

To see the Variable Explorer in action, you’ll work with the Weather History dataset from Kaggle, which contains hourly weather data from Szeged, Hungary, from 2006 to 2016. The dataset includes fields such as date and time, temperature, humidity, and wind speed. To download it, visit the link and click Download. You’ll need a free Kaggle account to access the file.

Start Spyder in a project directory of your choice. Before creating the Python file below, save the weather dataset as weatherHistory.csv in a data/ folder.

Next, create a Python file named weather.py in your project directory. As mentioned before, it’s a good idea to have a package like pandas installed in your Python environment when working with Spyder. Here, you use pandas to read the weather data you downloaded earlier:

Python weather.py
import pandas as pd

weather_data = pd.read_csv("data/weatherHistory.csv")

Run the program by clicking the green run arrow in the toolbar. To examine this DataFrame, open the Variable Explorer pane:

Variables shown in the Variable Explorer
The Variable Explorer

The Variable Explorer shows variables and their types, sizes, and values. Here, you can change Python objects such as strings, NumPy arrays, and DataFrames.

One cool feature of Spyder is that you can investigate DataFrames even further. Click anywhere in a DataFrame’s row. A DataFrame viewer window appears, showing the data in the DataFrame. If you want to edit values, then you can do so directly in this table view:

Data frame shown in Variable Explorer
Table View

Remember to click the Save and Close button to save the value for this session. Note that this action saves the value for this session only in memory, not to the data file itself.

The Options menu, located under the menu icon (☰), allows you to filter which objects you see. You can exclude specific variables—private, all-uppercase, or capitalized—as well as unsupported data types. By default, the system excludes callables and modules. You can also opt to show the minimum and maximum values of NumPy arrays instead of their values.

Right-click a field in the Variable Explorer to edit values, insert rows or columns, or change the cell type.

For more information about the Variable Explorer, check out the Spyder documentation.

Visualize Data in the Plots Pane

The Plots pane displays static snapshots of your plots for a quick overview. You can cycle through them forward or backward, save a plot, copy it to the clipboard, or remove it from the IDE. Zooming in and out is also supported, and you can undock the window to move it to another monitor.

To see more of what Spyder can do, create two plots with the help of pandas and matplotlib that you installed earlier:

Python viz_demo.py
import pandas as pd
import matplotlib.pyplot as plt

weather_data = pd.read_csv("data/weatherHistory.csv")
weather_data_five_days = weather_data[:120]

plt.figure()
plt.plot(weather_data_five_days["Formatted Date"],
         weather_data_five_days["Temperature (C)"])
plt.title("Temperature Over Time")
plt.xlabel("Date")
plt.ylabel("Temperature")
plt.xticks([])
plt.show()

plt.figure()
ax = plt.axes(projection="3d")
ax.set(title="Temperature, Humidity, and Wind Speed",
       xlabel="Temperature (C)", ylabel="Humidity", zlabel="Wind Speed (km/h)",
       xlim=(0, 21), ylim=(0.5, 1), zlim=(0,30))
ax.scatter(weather_data_five_days["Temperature (C)"],
           weather_data_five_days["Humidity"],
           weather_data_five_days["Wind Speed (km/h)"])
plt.show()

The code reads the data file and filters it to the first five days, or 120 rows, then uses matplotlib to create two plots. Run the code and open the Plots pane. A view like the following appears:

Example of Plot Window in IDE
The Plots Pane

By default, figures generated by your code are displayed only in the Plots pane. If you want them to also appear in the console, go to the Options menu in the top-right corner and deselect Mute inline plotting.

To cycle through plots, click the left arrow in the top-right corner to go back or the right arrow to move forward. Additional buttons let you save a plot, zoom in or out, or remove it from the pane.

To interact with plots, display them in separate windows. In Spyder, click Preferences, then select IPython Console in the left pane and open the Graphics tab. Switch the Graphics backend dropdown from Inline to Automatic, then click Apply and OK.

When you rerun the code, the plots appear in separate, interactive windows. In these windows, you can take advantage of dynamic features, such as rotating a 3D graph.

Mitigate Bottlenecks With the Profiler

The Profiler determines the runtime and number of calls for each function and method in a file. By examining this information, you can identify performance bottlenecks in your code. You can also save and compare profiling results across runs.

As an example, suppose you want to extract a subset of the weather data where the humidity is greater than a given threshold. A colleague of yours notices that this operation takes longer than expected in their code and asks you why it takes so long. The following code shows their implementation:

Python profile_demo_1.py
import pandas as pd

def find_humidity_rows(df, target):
    results = []
    for _, row in df.iterrows():
        if row['Humidity'] >= target:
            results.append(row)
    results = pd.DataFrame(results)
    return results

weather_data = pd.read_csv("data/weatherHistory.csv")
hi_humidity = find_humidity_rows(weather_data, 0.90)

You know that iterating over the rows of a DataFrame is bound to be slow, but it’s worth investigating where Python spends its time.

When you run the Spyder Profiler, it shows you two things:

  1. Local Time: The time spent executing only the function itself.
  2. Total Time: The time spent executing the function and all the functions it calls.

When you look at find_humidity_rows() in the Profiler, you see these results:

Profiler before adding option
Profiler Results

The local time for this function is 62.23 ms. The total time is a whopping 3.73 s. For future comparison, you save the profile results.

You tell your colleague that a better approach is to use the built-in, optimized pandas functions shown below:

Python profile_demo_2.py
import pandas as pd

def find_humidity_rows(df, target):
    return df.loc[df['Humidity'] >= target]

weather_data = pd.read_csv("data/weatherHistory.csv")
hi_humidity = find_humidity_rows(weather_data, 0.90)

Now, the Profiler gives you a set of numbers for the function that look quite different from the previous results:

Profiler after adding option
Profiler Results After Code Changes

You see that the same function now has a local time of 48.67 µs and a total time of 905.33 µs. That’s quite an improvement.

For a comparison of the two approaches, you load the profile file you saved from the original code. The Profiler information now shows differences:

Profiler diff of code before and after adding option
Profiler Results Comparison

The function has improved its local time by 62.18 ms and the total time by 3.73 s. Clearly, using a built-in pandas function is the way to go.

For more details about profiling in Python, check out Profiling in Python: How to Find Performance Bottlenecks or the lesson called Profiling Before You Optimize from the Profiling Performance In Python video course.

Beware of Limitations and Gotchas

Spyder is tailored for data science and scientific programming workflows, but it isn’t well suited for general-purpose software engineering. If you’re working on a full-blown software project, you’re probably better off using another tool such as Visual Studio Code.

Spyder is designed specifically for Python. This is great if you’re using Python, but if your project is written in a different language or uses multiple languages, then Spyder won’t be a good fit.

One minor annoyance is that you may find some of the default keybindings awkward. For example, many Mac developers use Cmd+Shift+Right to select text from the cursor to the end of the line. Fortunately, the keybindings are customizable. With a bit of tweaking, you can tailor them to match your preferred workflow.

Conclusion

Spyder is an excellent choice for data scientists looking for an easy-to-use IDE with good plotting, debugging, and profiling capabilities. Its easy access to the Variable Explorer, Plots, and Profiler makes it an attractive choice for quickly iterating on data analysis and for smaller data science or scientific programming projects.

In this tutorial, you’ve:

  • Installed Spyder and configured it for Python development
  • Explored the Spyder interface, including the Editor and IPython Console
  • Inspected and modified variables using the Variable Explorer
  • Visualized data using the Plots pane with pandas and Matplotlib
  • Profiled code to identify and reduce performance bottlenecks

With these skills, you can confidently use Spyder for data exploration, visualization, and performance tuning in your Python projects.

To explore other tools and workflows in the Python ecosystem, check out these related Real Python resources:

Don’t forget to get your handy Spyder IDE cheat sheet at the link below:

Take the Quiz: Test your knowledge with our interactive “Spyder: Your IDE for Data Science Development in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:


Interactive Quiz

Spyder: Your IDE for Data Science Development in Python

Test your knowledge of the Spyder IDE for Python data science, including its Variable Explorer, Plots pane, and Profiler.

Frequently Asked Questions

Now that you have some experience with the Spyder IDE in Python, you can use the questions and answers below to check your understanding and recap what you’ve learned.

These FAQs are related to the most important concepts you’ve covered in this tutorial. Click the Show/Hide toggle beside each question to reveal the answer.

Yes. Spyder is a free, open-source IDE focused on Python, designed for data science and scientific workflows.

Yes. Spyder is open source, costs nothing, and can be downloaded as a standalone app or installed with pip or conda.

No, Anaconda is optional. Spyder can be installed on its own, although many data-focused distributions like Anaconda and WinPython bundle it.

Yes, it can, with an optional plugin. For extensive notebook use, Jupyter or VS Code might be a better fit.

Change the IPython Console graphics backend from Inline to Automatic in Preferences, then rerun your code to open interactive windows.

🐍 Python Tricks 💌

Get a short & sweet Python Trick delivered to your inbox every couple of days. No spam ever. Unsubscribe any time. Curated by the Real Python team.

Python Tricks Dictionary Merge

About Mark Pedigo

Mark Pedigo is a data scientist with a PhD in mathematics who writes about mathematics, machine learning, and Python.

» More about Mark

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Master Real-World Python Skills With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

Master Real-World Python Skills
With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

What Do You Think?

Rate this article:

What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment below and let us know.

Commenting Tips: The most useful comments are those written with the goal of learning from or helping out other students. Get tips for asking good questions and get answers to common questions in our support portal.


Looking for a real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!

Keep Learning

Related Topics: basics data-science tools

Related Tutorials: