Spyder IDE and Command Line: The Basics

A Step-by-Step Code-along Guide for Data Science Tools

Angel Mariano
Python in Plain English

--

Here, we are going to learn the Basics of the 2 most essential tools used in Data Science:

  1. Spyder (The Scientific Python Development Environment)
  2. Command Prompt (Windows Command Line)

2. Introduction to the Spyder IDE

Spyder is a powerful scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts.

Getting Started:

Launch the Spyder App

Familiarizing the Spyder IDE App

  • Code Block — Editor: This is where we write Python codes
  • Current Working Directory: Link/Directory of the folder you want to work on
  • Variable Explorer: Shows the variables present in the Python environment
  • File Explorer: Shows the files inside the current working directory
  • IPython Console : Displays the output of the Python Code
  • History Log: Stores the last 100 commands you’ve typed in the console

Execute a code

  • Write a python code in the code block, then click F5 to execute the code.
  • Here I have tried printing “Hello FTW4”, and as seen in the IPython Console, it prints the output.

Creating Variables

  • Here, I have introduced new variables called “x, y and z” where z is the sum of y and x.
  • After executing the code, where I also printed the value of z, the output which is equal to 24 is now printed in the IPython Console.
  • One thing to also notice is that the Variable Explorer is also populated now with the 3 declared variables “x, y and z” with their respective type, size and value.

Reading a File

Using the library “Pandas” we can read files in Spyder IDE.

  • Here, after importing the pandas library, use the .read function to read files from local folder.
  • Check if the Variable Explorer is now populated with the Dataframe containing the size (rows,column) of the file uploaded.

2. Command Prompt: A Guide To The Windows Command Line

The Windows command prompt is a feature that’s been a core part of the Windows operating system for a long time. It lets you communicate directly with your computer and instruct it to perform various tasks.

A step-by-step guide for the basics:

Open the Command Prompt (cmd) — Windows command line.

Navigating through folders using cmd.

From the image, boxed is the Current Working Directory.

To change the directory:

  • Type in “cd” (change directory) before the desired folder to be directed. Press tab to shortcut typing or auto-complete the folder names.

To go back to the previous folder:

  • Type: cd ..

Moving multiple steps at a time (folder within a folder):

  • Use the separator backslash “\” . Type in Folder1\Folder2

Moving back multiple steps:

  • Use “slash”. Type: cd ../..

Learning the basics of Spyder and Command Prompt has got to be an essential step for your Data Science Journey. So, it is best to get an in-depth knowledge of at least 2 Data Science tools because it will surely step up your game! To learn more about these available analysis tools in the market, you might want to check the article below:

Working with the best Python IDEs.

--

--