Ideal Python environment setup for Data Science | by Harshit Tyagi | Towards Data Science

Got a data science project at hand to start off? Not sure what would be the right Python establishment to smooth the process? You need not go any further as this post will resolve all the hiccups around the data science environment to work locally. We’ll cover the tools, packages or software you might need to install before you start beating the sh*t out of that data.
The three elements you need to start off with your project are:
A UNIX shell on your machine and some familiarity with it.Anaconda — your package and environment manager, a Python data science distribution with a collection of over 7500 open-source packages.Git and GitHub — Version your projects with the most amazing version control system for tracking changes, and optimizing collaborative development.
A UNIX shell on your machine and some familiarity with it.
Anaconda — your package and environment manager, a Python data science distribution with a collection of over 7500 open-source packages.
Git and GitHub — Version your projects with the most amazing version control system for tracking changes, and optimizing collaborative development.
Hardly a day goes by when a data scientist or software engineer does not use UNIX shell to accomplish their plethora of analysis tasks.
Importance of UNIX shell for a data scientist:
After a certain stage, your project will have to go into production. You’ll be working on one of the cloud computing platforms like Google Cloud Platform or Amazon Web Services. Almost all platforms are Linux based and require you to work with the UNIX shell. Here’s a cheatsheet for shell scripting.
We’ll be using the command-line interface to install anaconda, git and perform other operations like starting jupyter notebook local server, committing and pushing our changes to the remote repository.
MacOS Users: Your systems already have a Unix shell(bash). If not, you can use Homebrew to install.
Windows Users: Windows doesn’t come with a UNIX shell. You can install Cygwin which provides a collection of GNU and open source tools and other functionalities on Windows.
To set up your python environment, you’ll first need to have a python on your machine. There are various python distributions available and we need the one that works best for data science. Anaconda comes with its own Python distribution which will be installed along with it.
Why Anaconda?
Data Science often requires you to work with a lot of scientific packages like scipy and numpy, data manipulation packages like pandas and IDEs and interactive Jupyter Notebook. Anaconda comes with Conda(for Command Line Interface) and Navigator(for Graphical User Interface). It works as a flawless manager for all these package versions and dependencies.
Now, you don’t need to worry about any python package most of them come pre-installed and if you want to install a new package, you can do that simply by using conda or pip.
Here is the step-by-step guide for Anaconda installation for MacOS:
docs.anaconda.com
Anaconda installation for Windows.
Anaconda installation for Linux.
Environment Management with Conda
As you’ll progress, you will find yourself working on multiple applications/projects. These applications will be dependent on different versions of Python/packages. You’ll be working with a team/partner and might want to standardize the configuration so that all of them are able to run the project.
In that case, you need to create and configure different environments.
And Conda has come to our rescue which allows us to create separate environments containing files, packages and their dependencies that are isolated from other environments.
Creating a new environment named dswh_envusing conda:
Creating a new environment named dswh_envusing conda:
conda create --name dswh_env
Your environment is now created but you’re not using it as of now.
2. Using or Activating the environment:
conda activate dswh_env
3. If you want to see all the environments in your systems, type:
conda info --envs
4. To deactivate the environment, use:
conda deactivate
Version control has been a blessing for programmers and Git is the most widely used version control system. It permits us to track our progress. We have a log of what we did when we did it and allows us to go back to a previous state of our project.
GitHub is a cloud-based code hosting service that helps you track your source code history. If we want to keep track of our project locally, we don’t need to use GitHub. But if you’re working with a team or if you want to showcase your project and skills, you can build a strong profile on GitHub by putting out your projects in the form of repositories.
Here’s the link to install Git for your respective machines:
Here’s the link to install Git for your respective machines:
git-scm.com
2. Create an account on GitHub if you don’t have one.
With the familiarity gained over each component, you should now be able to set up your environment using UNIX shell, Python & Anaconda, and Git.
With this channel, I am planning to roll out a couple of series covering the entire data science space. Here is why you should be subscribing to the channel:
The series would cover all the required/demanded quality tutorials on each of the topics and subtopics.
Explained Mathematics and derivations of why we do what we do in ML and Deep Learning.
Podcasts with Data Scientists and Engineers at Google, Microsoft, Amazon, etc, and CEOs of big data-driven companies.
Projects and instructions to implement the topics learned so far.
www.youtube.com
You can connect with me on LinkedIn, Twitter or Instagram(where I talk about health and wellness.)
Note: During these dark times, self-isolation has made some room for self-improvement which we can utilize to develop new skills, hobbies, and help our future-selves.