Skip to content
CBT Nuggets

Installation and Setup

This skill covers the setup and use of essential tools for Python data manipulation, including Pandas, Jupyter Notebook, Anaconda, and Conda environments. Learners will understand how to install and configure these tools, create isolated environments for projects, and utilize Pandas for data analysis and visualization. The course also highlights the differences between Jupyter Notebook and other IDEs like Visual Studio Code, emphasizing the iterative and interactive nature of Jupyter Notebook for data science tasks.

Full lesson from Python Pandas for Data Manipulation. Preview the IT training 23,000+ organizations trust.

53m 6 Videos 6 Questions

Skill 1 of 20 in Python Pandas for Data Manipulation

Introduction

In this set of videos, you’ll learn what Pandas, Jupyter notebook, Conda, and Anaconda are and how to use them to set up your development environment. Let’s unpack what you're going to learn, one by one.

What is pandas?

From the python website,pandas is a fast, powerful, flexible and easy to use open-source data analysis and manipulation tool, built on top of the Python programming language.”

In the following video, you’ll learn about the Jupyter notebook, which is also free and open-source and the de facto development environment for pandas. See you there.

What is Jupyter Notebook?

According to the Jupyter.org website, Jupyter notebook “is the original web application for creating and sharing computational documents. It offers a simple, streamlined, document-centric experience.”

As you can see, it can support many languages, is shareable, and works with big data(unlike Excel). But, again, it is free and open source.

So how do you install Jupyter notebook? Well, it’s not as simple as downloading a file and installing it. First, you will need Anaconda, a Python distribution for data science that includes all the libraries you’ll need to get started. See you in the next video!

Anaconda Installation

Watch the video and download the course files from GitHub when you are ready. Use the following link: https://github.com/cbtn-data-science-ml/python-pandas-for-data-manipulation

Conda Environments

Be sure to download the Conda Cheat Sheet if you need a resource to help you with the basic commands: Conda Cheat Sheet

Challenge

Open the terminal or Anaconda prompt and navigate to your project directory of choice for this course. Then, activate the conda environment for this course.

Knowledge Check

How do you activate a conda environment?

  1. Aconda confundo
  2. Bconda activate
  3. Cconda deactivate
  4. Dconda expelliarmus

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

How do you launch Jupyter notebook?

  1. Aconda obliviate
  2. Bnotebook
  3. Cjupyter notebook
  4. Dconda deactivate

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

How do you deactivate a conda environment?

  1. Aconda revelio
  2. Bconda activate
  3. Cconda deactivate
  4. Dconda bombardo

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

True or False: Pandas has documentation.

  1. A
  2. B
  3. C
  4. D

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

True or False: Pandas offers a GUI (graphical user interface) like Excel and Google Sheets.

  1. A
  2. B
  3. C
  4. D

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

True or False: Pandas is open-source.

  1. A
  2. B
  3. C
  4. D

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Challenge Question Answers (optional)

Supplemental Files

View Transcript

Introduction

0:07<v ->Hello and welcome.</v>

0:09My name is Jonathan Barrios

0:10and I'm excited to be your trainer

0:12for the Python and Pandas Data Manipulation course.

0:15In this set of videos,

0:16we're going to talk about pandas, Jupyter notebook,

0:20Anaconda, and Conda,

0:22with an aim of setting up our development environment

0:24for the rest of the course.

0:26Let's take a look at each one of these one-by-one.

0:31So this is pandas, and this is a pandas documentation.

0:34It actually has really great documentation.

0:36And this is what pandas sort of looks like.

0:38Here are some examples.

0:40And it's not like Excel

0:43that uses a graphical user interface.

0:45It's a programmatic approach to data analysis.

0:48So this is pandas,

0:49but you can't really download it right away

0:52using an installer or something like that.

0:54So let's take a look at the IDE,

0:56or the integrated development environment we're gonna use,

0:59Jupyter Notebook.

1:02This is Jupyter Notebook.

1:04And so what is Jupyter Notebook?

1:06Well, I said that it was an IDE,

1:09which is an integrated development environment.

1:12It's also called a interactive notebook.

1:16And Jupyter notebook, according to the website,

1:18is the original web application

1:21for creating and sharing computational documents.

1:24It's simple, streamlined, and document-centric.

1:28So what does that mean?

1:29Well, here you can see that you have a text cell

1:32with some text, some different formatting.

1:34And this is using markdown.

1:36You can also use LaTech, or LaTeX to write formulas.

1:42And this is the code cell where you would write your code,

1:45and it would generate an output

1:47of either a series or a data frame,

1:50which is basically like a spreadsheet

1:52or some sort of numbers,

1:54or in this case a visualization.

1:57And Anaconda is the Python distribution

2:00that we're gonna use to get you up and running

2:02with the packages and libraries that you'll need.

2:05And we'll use Conda to create environments,

2:09or also known as Conda environments.

2:12This might be a little bit tricky to understand

2:14without actually doing it.

2:15So my explanation is pretty straightforward.

2:18When you're creating a project,

2:19you're gonna need packages and dependencies,

2:21and they may be different versions

2:23from another project, and another project, and so on.

2:26You don't want to have all of your projects

2:27using multiple versions,

2:29and have all of them mixed together,

2:31'cause that'll cause conflicts.

2:33And it's also not very shareable.

2:34So Conda is included with Anaconda,

2:37and easily allows us to create Conda environments

2:40to make our packet

2:41or keep our projects separated and isolated.

2:45And this is a best practice

2:46for whenever you're doing data analysis

2:48and for sharing your work.

2:50You can also create a YAML file,

2:52or environment.YAML file,

2:54that you can easily send to somebody,

2:56and they can spin up the same exact environment

2:59that you're using so that they have the same experience.

3:03I hope you're excited. I know that I am.

3:05And I hope this has been informative

3:06and I'd like to thank you for viewing.

What is pandas?

0:07<v ->Hello and welcome back.</v>

0:09In this video, we're gonna talk about "What is Pandas?"

0:12So let's take a look.

0:14So you already know that Pandas is a fast, powerful,

0:18and flexible and easy-to-use open source data analysis

0:22and manipulation tool.

0:23And you already know that it's built

0:25on top of the Python programming language.

0:28But I also think it's important

0:30to talk about the documentation

0:32before we dive into the details about Pandas.

0:35For example, this getting started section is pretty cool

0:39because it shows you that if you're coming from SQL

0:42and you already have some familiarity,

0:43you can see the Select, Group By and Join,

0:46have equivalents in Pandas.

0:48And also that Excel basically has a lot of similarities

0:52and the concepts are transferable even though

0:55that the user interface is quite different.

0:59And here is the user guide.

1:01It's really helpful and has,

1:04I guess, there's 10 Minutes to Pandas,

1:06which is really great, but anytime that you're working

1:09with some sort of a method or attribute,

1:12or you have some sort of questions about the parameters,

1:15you can just type it in here.

1:18So let's say I'm working with a series,

1:19which is basically a column,

1:22you can just find that here

1:23and you can scroll through there.

1:25I think...

1:26Okay, so the first one, that's what I'm looking for.

1:29You'll be more familiar with these sort of dot notation,

1:32but that's the actual series class.

1:35So let's take a look at that.

1:38And this is great.

1:39If you ever want to get rid of these highlights,

1:40just take away the the fragment of URL

1:43after the question mark or the question mark and after,

1:46and then hit enter,

1:47and you'll just see the same documentation

1:49without all the highlighting.

1:51And then it gives you some examples that are really useful.

1:54And then we'll dive into the two major objects,

1:57which is basically a series and a data frame.

2:01So what is a series and a data frame?

2:04A series is basically a column and a data frame

2:07is two or more series put together or multiple columns.

2:11So just think rows and columns, right?

2:14Let me kinda explain that using the spreadsheet,

2:16I think this is probably the best way to visualize it

2:20and it should make quite a bit of sense.

2:22And if it doesn't now, it will when we start

2:24to get into Pandas.

2:27So this would be considered series.

2:30So this is a column.

2:31And if you have two or more of these series,

2:34well, that would represent something called a data frame.

2:37So it's very similar to a spreadsheet,

2:40except that we're not using a graphical user interface

2:43like a spreadsheet.

2:45But first, let's talk a little bit about

2:47the history of spreadsheet programs.

2:50This is not a new concept and I like to start here

2:53because a lot of people think that

2:55Excel was, sort of, the first tool, but actually it wasn't.

2:59It was something called VisiCalc.

3:00Let's take a look.

3:02So VisiCalc actually kind of looks like Pandas.

3:06So this is a programmatic version of a spreadsheet, right?

3:10It's not like Excel that we just looked at or Google Sheets.

3:13And here you can see that we have these columns

3:16and they're kind of glued together,

3:18and I would consider that a data frame.

3:20And then right here, you have the, sort of, the index.

3:23So this, to me, is already, kind of like, like Pandas,

3:27but this started in 1979

3:31and it was originally for the Apple II computer.

3:33So it's been around for a while.

3:35However, if you scroll down here,

3:37you'll see that the first program,

3:41spreadsheet programs were actually in 1961.

3:45So Pandas, in my opinion, the concept has been around

3:49for a a long time

3:51and there's always been a need for business

3:53to use spreadsheets.

3:54And so it's not Excel, the graphical user interface,

3:57that was the first one.

3:59That's just the de facto tool for businesses

4:03because it's visual and it doesn't require a lot of training

4:06and it became very, very popular.

4:08But I just wanted to show you that

4:10this is not a new concept.

4:12It comes from 1961.

4:14So let's dive into a little bit more about Pandas.

4:19So this is Pandas inside of Jupyter Notebook.

4:22So I just wanted to give you a little bit of a tour

4:24of the final project, which is "Visualizing Cryptocurrency."

4:28It's like a cryptocurrency portfolio,

4:31and I think this will give you a better idea

4:33of what Pandas is.

4:34Let's take a look.

4:36So in this very top section,

4:39we'll go over this in the course,

4:40but I just wanna show you that first you import

4:42your libraries and here, without having to do

4:45any web scraping at all,

4:47you're pulling information from the Internet,

4:49and in this case, what we're doing is going to Yahoo Finance

4:54and grabbing Bitcoin prices in real time.

4:58And if you look, it's just one line of code.

5:02If you know how to web scrape,

5:03you know that this is pretty awesome

5:05because you need to know HTML with web scraping

5:09and you have to write, sometimes, some functions,

5:11and you know, this is a lot more, sort of, work involved.

5:16With Pandas, you can use this data reader method here

5:21and it pulls that information.

5:22So I think it's really cool.

5:24So really something to look forward to

5:26at the very, very end.

5:27But let's keep on taking a look at this notebook

5:30to see what Pandas is like.

5:31So on top of that, well here is the data frame

5:34that I was talking about in the series.

5:37So this is our index, right?

5:39So instead of having numbers, we're using dates

5:41because we're working with cryptocurrencies.

5:44Same thing if you were working with stocks.

5:46And again, you can actually change the stock ticker here

5:49to something like, you know, Microsoft or something

5:52and it would work the same.

5:53So it's pretty cool.

5:54You can do cryptocurrencies or stocks.

5:58So this is a series right here and there's another series.

6:02And as you can see, we have a bunch of series

6:05and that collection of series represents a data frame.

6:08And so this is much like Excel or Google Sheets,

6:12but it's inside of Jupyter Notebook being powered by Pandas.

6:16You can also use Matplotlib, which we'll talk about,

6:19to visualize data.

6:20And so let's take a look at some of the visualizations,

6:23and at the very end, I'm gonna show you a moving average

6:26and kind of explain a little bit about that.

6:29So we have different ways of visualizing

6:31and they're called plots.

6:32We're plotting here,

6:33and these are the opening, the high

6:36and opening and closing prices.

6:38This is the opening, closing, and adjusted closing price.

6:42And you're plotting more than one column in this case.

6:45Here, you're plotting the volume.

6:50And here, we have the moving average.

6:53So what's happening here?

6:54So we're taking 10, 20, and 50-day periods

6:59and smoothing out that line.

7:01So what does that mean?

7:02Well, let's take a look at this output.

7:05This is our data frame with all of the real time information

7:08from Yahoo Finance.

7:09And this is a visualization.

7:11And what it's doing is that normally,

7:13you would see a lot of this up and down, sort of, behavior

7:16and, sort of, stock ticker, right?

7:18And cryptocurrencies, especially, do stuff like this, right?

7:22But what we're doing here with the moving average

7:25is smoothing that line out.

7:26And that's why we have these different lines.

7:29And you can see here we have a legend that shows you

7:31the 10, 20, and 50 days.

7:34And this is helpful to know when the prices are going up

7:37and when the prices are going down.

7:39Clearly it's going up and then it's going down.

7:42You can see here this is a low point

7:44and this is very useful when you're trying to manage

7:47a stock portfolio and trying to decide

7:51about purchasing and so on.

7:53So I just wanted to give you a little bit preview

7:54and I think this is a nice explanation

7:57about what Pandas is.

8:01In the next video, we'll dive into Jupyter Notebook

8:03because we really can't use Pandas

8:05without some sort of a integrated development environment.

8:09You could use Visual Studio Code,

8:11but interactive notebooks such as Jupyter Notebook,

8:14which is a, or IDE,

8:16is really, probably, the most popular tool

8:19and that's what we were looking at just now.

8:21So without further ado, I will see you in the next video

8:25and I hope this has been informative

8:27and I'd like to thank you for viewing.

What is Jupyter Notebook?

0:07<v ->In this video, we'll talk about Jupyter Notebook.</v>

0:10So we already talked about pandas and what pandas is,

0:13but how do you use pandas?

0:14Well, you would use

0:15some sort of a interactive development environment.

0:19But before we talk about Jupyter Notebook,

0:20I want to show you Visual Studio Code,

0:23which is another option for using pandas,

0:25and it's probably the most popular IDE out there.

0:28Let's take a look.

0:30This is Visual Studio Code.

0:32Again, probably one of the most popular IDEs

0:34out there right now.

0:36And it's popular for, mostly for programmers, I would say,

0:39compared to data analysts and data scientists.

0:42But if you're really working more on writing functions

0:47and classes and things like that,

0:49this is just as good as Jupyter Notebook in many ways,

0:53but here's the main difference.

0:55What makes this an integrated development environment

0:57is that you have a section here with extensions

1:00and this bottom part is a terminal

1:02that allows you to access,

1:04well, it's the terminal command line,

1:06and you can run the script from the terminal

1:09and you can also install packages.

1:11But what's different

1:12is that you write a bunch of lines of code,

1:17then you write something like app.py,

1:20if that's the name of your file,

1:22and when you execute that,

1:24then you get your output down here.

1:26And the output is not gonna look that great

1:28and you can't really visualize things

1:30'cause what it will do is it'll create a popup

1:33showing you that visualization, and that's okay.

1:36Again, it really just depends on what your needs are.

1:41If you're just getting started

1:43and you're coming from Excel or from SQL,

1:46I think Jupyter Notebook is the way to go.

1:49However, you can definitely use Visual Studio Code.

1:52So let's check out Jupyter Notebook next.

1:57Okay, so this is Jupyter Notebook,

2:00and what's the difference?

2:01Well, the main difference here

2:03is it's an iterative development environment, right?

2:06So that's not the same as IDE,

2:10which is integrated development environment,

2:11but let me explain what I mean by iterative.

2:14So you would write some code

2:17and then you execute that code

2:19and immediately you get the output.

2:21You write some more code,

2:22and immediately you get that output, right?

2:24So it's all self-contained in this one notebook, right?

2:28So that's why people call it an interactive notebook.

2:32Also, what's really great about Visual Studio Code

2:35is that you have over 40 languages that you can use.

2:38It's super easy to share,

2:40and if someone doesn't understand Python,

2:42well, they can look at this

2:44and kind of get an idea of what's going on,

2:46depending on what project you're sharing.

2:49For example, we looked at the stock prices

2:53or Bitcoin prices from Yahoo Finance,

2:56and that was pretty straightforward in that visualization.

2:59Reading the code, if you have comments,

3:01makes it a lot more accessible

3:03for people who don't know how to write code

3:06or Python, right?

3:07So that's kind of the main difference

3:09between those two integrated development environments.

3:13You can also use LaTeX and HTML

3:17and images and even videos.

3:19So it's an interactive output and it's great for big data.

3:23So there's integration with,

3:26here it says pandas, scikit-learn, and TensorFlow

3:30and Apache Spark, Python, R, Scala.

3:34So it's really pretty amazing,

3:36and no wonder it's famous, right?

3:39It's got a lot going on.

3:43And this is what Jupyter Notebook actually looks like

3:45when you get it up and running.

3:47And if you wanted to look at something,

3:48well, we're looking at the cryptocurrency,

3:51this is our project at the very, very end.

3:53We could also look at different charts.

3:56So here again, we have importing of libraries

4:00that we're gonna be using.

4:01Here, you can see this is how you use pandas.

4:04You import pandas

4:06and the data reader that pulls things from Yahoo Finance,

4:09that's how you use that.

4:10This is the library that we use for visualization

4:14and we'll talk about this little line of code later.

4:18So here what we're doing is basically scraping the Yahoo

4:21to get some Bitcoin prices in real time.

4:25And if we scroll down, you can see

4:28that whenever you execute that code, this is the output.

4:32So here, this is the iterative part

4:35that I was talking about.

4:36You write the code and then you get an output, right?

4:39If we keep going, you write the code.

4:43In this case, two code cells, and then you get this output.

4:46And same thing here, it keeps going,

4:48and I think this makes a lot of sense.

4:50You write your code here

4:51and when you execute that, you get this, right?

4:54And so on and so forth.

4:55So here are some different forms of visualizations.

4:58Not a fan of pie charts,

4:59but that's how you would create a pie chart.

5:02And again, you can't just install Jupyter Notebook

5:05using an installer.

5:07Well, I mean you can if it's the Anaconda installer.

5:10And that's what we're gonna use to install Anaconda.

5:14So in the next video, we'll talk about Anaconda,

5:17and then in the subsequent video,

5:18we'll talk about conda environments.

5:21I hope this has been informative,

5:22and I'd like to thank you for viewing.

Anaconda Installation

0:07<v ->Alright, so we're finally gonna get to install our</v>

0:09development environment, and that's gonna be with Anaconda.

0:14So let's take a look at the Anaconda website

0:16and install this.

0:18I'm on a Mac, so I'm gonna show you how

0:19to install this on a Mac,

0:20but I'm also gonna point out how

0:22to install this on a Windows operating system

0:25and some of the things that you need to look out for so

0:27that we're actually using the same tools

0:30and then using the same syntax.

0:32So let's get started.

0:35Okay, so this is the anaconda.com website

0:39and we're going to download here.

0:41I could just click on this and be done with it

0:43because I'm on a Mac, but I do wanna show you the

0:45additional installers.

0:46So let's take a look at those.

0:50So here we have a Windows option.

0:53And what I want to point out here is

0:55that you wanna make sure that you're using the right version

0:57or the the correct bit.

0:59So it's more common for you to have a 64 bit version

1:03of Windows installed than a 32 bit.

1:06But if you're using a 32 bit version of Windows,

1:09then please use that because

1:10otherwise you're gonna get a lot of errors.

1:12So that's the first thing to keep in mind.

1:14After we install this, I'm gonna point out

1:17how you can use the Anaconda prompt.

1:19So that's the only other difference.

1:21So let's jump into the installation process now.

1:26Okay, so we're going to use the graphical installer.

1:30And so for Windows,

1:31that's the only one that you have available.

1:33So you could use the command line installer,

1:37but the reason that I'm, I'm not gonna do that,

1:40is I think it's a lot easier if you're just starting out

1:43to use the installer.

1:45It's the same thing using the installer versus the command

1:48line, but I just wanted to point that out.

1:51Okay, so let's go ahead and click on the graphical installer

1:55and we're gonna go ahead and just download that.

1:59I'll close this,

2:01and this is pretty for me, it doesn't take very long

2:04to get this up and running,

2:06but we're gonna run this, I already have this installed,

2:09so I'm not gonna go through every prompt,

2:12but I will guide you through this process just

2:14to make sure that you have it.

2:16So it opened up in another screen for me.

2:18So let me drag, drag this over. There we go.

2:21Okay, so you'll be guided through the steps necessary

2:23to install the software continue.

2:25And what's it's talking about here is the modified path

2:29options, and it's talking about how it's changing that path

2:32and, and also it's talking about everything

2:35that is gonna install.

2:37So what is it installing?

2:38Well, you can see

2:39that it's installing a lot of different packages.

2:41You saw Anaconda, let's see,

2:44we even babble if you're familiar with that.

2:46Let's see what else we have here.

2:47We should definitely have, this is good for a

2:49optimization for speed.

2:53It'll have Conda and that's what we're gonna use

2:55for the conda environments.

2:58And let's see what else we should have.

3:00Pandas, Flask is for web development

3:08And ipi I, Python is similar to Jupyter Notebook,

3:13but we should have a Jupyter Notebook

3:17or maybe it's called Notebook, I think here.

3:19So let's look for that. Map

3:22Plot Lib is used for visualization and notebook.

3:26There we go. This is actually Jupyter Notebook, so it's,

3:30that's, it's just a little bit different syntax there.

3:33And then we have Pandas somewhere. There's Pandas.

3:36So basically it's a lot of stuff we can keep going.

3:40We might find Seaborne, which is another visualization tool.

3:44Yep. And there's Seaborne.

3:45So you see it really just installs a lot of stuff

3:48for you out of the box.

3:50Otherwise you'd have to be sort of installing the package

3:54and doing it for each and every one.

3:56So this just makes it a lot easier to get started.

4:00Okay, so what we're gonna do is just click continue

4:03and this is the eula, the end User license agreement.

4:05So be sure to read this and then continue when you're done

4:09and you accept and agree

4:14and then you can decide how you want

4:15to install this software.

4:17I'm not going to continue,

4:19but basically you don't need to install Pie Charm, IDE.

4:22That's another integrated development environment.

4:24It's pretty cool. But we don't need that in this case

4:27because we're gonna be using Jupyter Notebook.

4:30So once you're in, so I'll, I'll say install for me

4:32and then you can change the location

4:34and then you can say install, which I'm not gonna do.

4:37So I'm just gonna go, go ahead and close out of here.

4:40Okay, so once you have it installed

4:42and you open your terminal, well,

4:43before we do that, let's go ahead

4:45and download the course files.

4:48So these course files are really important

4:50for multiple reasons.

4:51Here's the first reason. There's gonna be a set

4:54of completed files

4:56and that will show you all of the correct code that works.

4:59So let's say you're working on something

5:00and there you're just having a problem,

5:02or you can look at the correct code, you can download

5:04that notebook or just open that notebook and try it out and

5:07and make a comparison there.

5:08The other reason is that there's starter files,

5:11so we're gonna start with the same documents

5:13and then you fill it in as you progress,

5:15and then you'll have all of your Jupyter Notebooks with all

5:19of the code that you learned in this course.

5:21So it's really a great resource.

5:23So let's take a look at the URL so

5:24that you can download this as well.

5:28So the UL is up here. Let me make this a little bit bigger.

5:39This is really big. Lemme see right here.

5:42You should be able to see that.

5:43Basically that is github.com,

5:47cbt n dash data, dash science dash ml.

5:51And it's also linked above this video.

5:53So just click on that and then we'll be on the same page.

5:57So what we're gonna do here is we're gonna go to, let me,

6:00this is a little bit too big, so let me get down to 150.

6:03Okay, so we're gonna go to Python pandas

6:06for data manipulation,

6:08and it's a pin for repository, so it's super easy to find.

6:12And what you wanna do here is one of two things.

6:14First, you can go to download zip

6:17and then manually add these to your working directory.

6:20If you don't have GitHub, if you do have GitHub,

6:23then I would recommend Forking this,

6:24and that will create a repository in your account

6:27and then go ahead and start.

6:28So you can get updates as I make any changes as needed.

6:33And then what I'm gonna do is just copy this

6:37and then head over to the terminal.

6:42Okay, so when you first install Anaconda,

6:46you're gonna see that you're in a base

6:48environment for Windows users.

6:50You want to go to the start menu and type Anaconda,

6:53and you're gonna probably see something like

6:55Anaconda Prompt.

6:57Go ahead and click on that.

6:58And that's gonna be your version of the terminal on a Mac,

7:01I'm using the terminal.

7:02This is what you're looking at for you on a Windows machine.

7:05You want to use the Anaconda prompt,

7:07and then the syntax is all gonna be the same.

7:10So it should work pretty much identically.

7:12So I just wanted to point that out

7:15so we have a base environment,

7:16but in the next video we're gonna create our

7:18environment using conduct.

7:20So we're just setting things up right now,

7:22so don't worry about this base for now.

7:26Okay, so the first thing we want

7:27to do is create our working environment.

7:29So I'm gonna go to my documents folder,

7:32and you can go wherever you would like

7:34and create your folder there.

7:36So I'm going to go to Documents and say Get Clone

7:40and then paste that folder there

7:42or that link to get it to clone from GitHub.

7:45But you can also do this manually, right?

7:47So you download that zip file, open that zip file,

7:51and put it in whichever directory

7:52that you wanna have those files in.

7:54And then it'll be the same.

7:56There's just whatever's more comfortable for you.

8:00Okay, so I'm gonna hit enter, and now I'm cloning

8:02and I've cloned all of those files.

8:04And I'm gonna jump into that folder by typing cd.

8:08And then let me spell that correctly.

8:13cd, Python, pandas for Data Manipulation.

8:17Cool, I'm in that folder now.

8:18And you can see that

8:20that change from documents to this folder.

8:22And if I use the LS command,

8:24I can see what's inside of that.

8:26So I want to, I don't want

8:28to jump into these and I'll show you why.

8:30What we're gonna do now is just type Jupyter Notebook.

8:36All right, so let me show you what happened.

8:38So right now, there's no command line.

8:40I can't type anything because it's running server.

8:43This is Jupyter Notebook running a server,

8:46and it's in a browser, so it actually runs in a browser.

8:50And that's how Jupyter Notebook works.

8:52So let's take a look at the completed and the starter files.

8:56So here are the starter files, click on that.

8:59If you go to data sets, these are all the data sets

9:01that come with that, but they're also inside of each

9:06sort of skill.

9:07So this is Skill three, Panda series intro,

9:10and you can see that these are already there.

9:13And that'll make more sense when we start

9:14to use these files.

9:15So if you go to the first one, there's nothing there

9:18because there's no, we are just installing things

9:21and there's no Jupyter Notebook yet.

9:24The second one, which is gonna be the next set of videos,

9:27that's the first one that has an actual Jupyter Notebook.

9:30So let's go ahead and click on this one. Cool.

9:35So this is our Jupiter notebook.

9:37Let's make sure that we have Python installed.

9:40You can see that it says Python Kernel three,

9:43and I'm just gonna say print.

9:48We'll just do the hello world, the famous hello world

9:50to make sure the Python is installed.

9:54Okay. And I do shift enter.

9:57That's how you execute these cells.

9:59You can also just click on run,

10:03but I think using shift enter is actually

10:06a better way to do that.

10:07Okay, so we have our development environment set up

10:10with Anaconda,

10:12and in the next video we're gonna talk about

10:14Conda environments.

10:15And that's the last thing we need to do

10:17before we get started,

10:19and it's really important to get into that.

10:20But once you know how all this works,

10:22it's pretty straightforward

10:23and it's a best practice to use Anaconda

10:26and Conda environments.

10:27And once you have Jupyter Notebook up

10:29and running with Pandas, it's gonna be a lot of fun.

10:32So I hope this has been informative,

10:34and I'd like to thank you for viewing.

Conda Environments

0:07<v ->Welcome back.</v>

0:08This is the last video of setup

0:10for a development environment,

0:11and we're gonna dive into conda environments.

0:14Alright, so let's take a look at where we left off

0:17and we're gonna jump into the Jupyter notebook

0:19and take it from there.

0:22So this is the Jupyter Notebook,

0:24and what I'd like to do is show you this other tab,

0:27and you can see that it's, these are our notebooks

0:29and this one is green.

0:31So what we wanna do is click on this and click shut down.

0:34So this notebook is now shut down.

0:36So we can just close this tab, say leave,

0:40and then you want to quit, click on quit here.

0:44And when you do that, it shuts down the server.

0:47So this server was running, and now it's shut down.

0:51We'll get into this a lot more in the next set

0:53of videos when we get into the Jupyter Notebook

0:56set of videos.

0:57But for now, I just wanted to show you that,

0:59well there was a server and now it's not running anymore.

1:02I think this is kind of important to mention

1:04because look at all this stuff, it looks kind of wild.

1:07So I just want to kind of, sort of explain that.

1:09Let's go ahead and use the clear command to clear this up.

1:13So if I type clear,

1:15we'll get a a little bit nicer looking sort of terminal.

1:18So how do we want to install conda environments?

1:22Well, the easiest way is to make sure

1:25that we have conda installed first.

1:26So let's just say conda --version.

1:30Hit that, you get conda 4.1, 4.11.

1:35Okay, cool, so we have that set up.

1:37Now we want to create our conda environment.

1:42So make sure that you're still in your working directory.

1:44So this is my working directory

1:46that I downloaded from GitHub.

1:48And when you're working in the future,

1:49you can create any folder and start from there.

1:51But this is where we're working from for now.

1:54And what we're gonna do is say conda create --name,

2:00and that's gonna be the name of the environment,

2:01and I'm just gonna say something like pandas.

2:07Pandas CBTN, right?

2:11For CBTnuggets.

2:13Alright, so if I click enter,

2:16oh well, that's a good mistake.

2:19I didn't add the a at the end of conda.

2:22And so that's what happened. So let's try that again.

2:24Alright, so it's running

2:26and it's asking me, "Hey, do you want to proceed?"

2:28I'm gonna say, "Yes, I do."

2:29And what's cool about this is it's gonna say this is

2:33what you need to enter to activate that.

2:35So I'm gonna copy that and I'm gonna paste that here.

2:40And when I run this, you're gonna see

2:43that we went from the base environment to now, to CBTN.

2:47Okay? So that's really important. So let me clear this up.

2:52And this is how you know that you're in

2:53that new conda environment, right?

2:57This is where you want to install things.

2:59However, if we start to type Jupyter Notebook,

3:02it's not gonna work because we have to install everything

3:05that we're gonna use in this project.

3:07So it's a clean slate,

3:08let's go ahead and add the packages in the

3:10libraries that we're going to use.

3:13Okay, so first what we wanna do is type, we're gonna type

3:19conda install, and we're gonna install pandas,

3:25jupyter notebook,

3:28jupyter notebook.

3:31And we're gonna install numpy and matplotlib.

3:37Okay, let's enter that and see if that'll work.

3:41You wanna proceed? Yes, I do.

3:44And then this will take a couple minutes to install.

3:47Once it's done installing,

3:48then we can actually type in Jupyter Notebook again,

3:51and that'll open up.

3:52And this is your conda environment.

3:54When this is done, I'm also gonna show you how

3:56to deactivate it and how to look at other,

4:00or let's say like you just forget the

4:02name of the conda environment,

4:03I'm gonna show you how to look that up.

4:07Okay, so here we are. Let me clear all of this up.

4:10So I'm gonna say enter clear

4:12and I'm going to deactivate this.

4:15So I'm gonna say conda deactivate.

4:21And then I'm now back at the base environment.

4:24But let's say I want to activate it again

4:25and I type in conda activate,

4:28maybe this has been like I did it, you know,

4:31maybe tomorrow, right, or next week,

4:33and I just forgot what it was called.

4:34I'm like, what did I name it, panda something, right?

4:38Well what you can do here is conda list evns,

4:44evns, for environments.

4:47Once I enter that, it's gonna show me what I have.

4:52Did I do that correctly? No, I didn't.

4:56So conda list

4:58or is it conda env list?

5:10Yeah, so I just mixed up the syntax,

5:13but basically it shows you every project that you have.

5:17So I have multiple projects.

5:19So this is the one that I usually use,

5:21or this is the one that I created and activated.

5:24So I'm like, okay, cool, I'll just copy that

5:26and I'm gonna say, conda activate.

5:31And then you say panda cbtn, and boom, I'm in there.

5:34Now, I'm gonna say jupyter notebook

5:38and let's see what happens.

5:41Drum roll please.

5:44Boom, it works.

5:45So what's happening in the background, we have

5:47that server running again

5:49and Jupyter Notebook is working inside of the browser.

5:53And you can go to your starter files

5:55and in the next set of videos, this is where gonna start,

5:58right here on 2_3 where we're gonna take a tour

6:01of the user interface.

6:04Okay, so that was a lot of information.

6:06The first time that you might hear this,

6:08it might be a little overwhelming,

6:11or just a lot of, you know, it might be a little bit,

6:12the concepts might be a little bit fuzzy,

6:13but every time that you work with Python and Pandas

6:17and Jupyter Notebooks and conda, you're gonna do this,

6:21there's gonna be a startup and a shutdown process,

6:23and I'm gonna show you that the next set of videos.

6:26And we're gonna do that every single time.

6:27So it's gonna be something that's gonna become very,

6:29very natural.

6:30The first time you do this,

6:31it may, if you have a programing background, no sweat.

6:35But if this is something that new to you

6:36and you're coming from Excel,

6:38this is gonna be something that'll become very familiar

6:40and you can always review this video

6:42and it's pretty much straightforward.

6:45So I hope this has been informative

6:46and I'd like to thank you for viewing.

Challenge Question Answers (optional)

0:07<v ->Congratulations on making it</v>

0:08to the end of this set of videos.

0:11In this section, this video is about a challenge

0:15and so at some of these,

0:17at the end of some of the sections of videos,

0:20there may be a challenge.

0:21And so I wanna talk to you a little bit about the challenge

0:24and kind of go over each one of these.

0:25And the reason for that is how about if you get it wrong?

0:30I could add a hint inside of the questions,

0:32but it's not as effective as me talking about it

0:34and showing you explicitly, right, through a video.

0:38And I find that that's a lot more effective.

0:40So that's what we're gonna do.

0:41Not every end of section will actually have a challenge,

0:45but if there is a challenge, there will be a video as well.

0:49So it's really important that you go ahead

0:52and try to do this on your own.

0:54So answer all of the questions.

0:56And if you get them wrong, no worries, just keep going.

0:59Watch this video and then we'll clear it up

1:02and then go back and then revisit the answers

1:05that you got wrong.

1:06So let's get started.

1:07Let's check this out.

1:09Okay, so here is the terminal.

1:12So what is the first question?

1:15So first of all, we're setting this up.

1:17We're saying navigate to your project directory of choice

1:20for this course.

1:21Well, I'm already there.

1:22This is what mine is, right?

1:24So that's where I'm gonna be working out of.

1:26So that's good.

1:27Next it says, open the terminal or add a conda prompt

1:31and activate the conda environment for this course.

1:34So what do I mean by that?

1:36Well, open the terminal.

1:38Well, it's already open.

1:39So you have to open the terminal

1:41in order to navigate to the directory anyway.

1:43So a conda prompt is if you're on Windows.

1:46And how do you activate this environment?

1:51Well, first of all, I'm going to deactivate

1:55'cause I'm not, let me go ahead and do that first.

2:01Okay, so I'm gonna hit clear and we'll start over.

2:04Okay, so how do we activate a conda environment?

2:08Well, first of all, I think I forgot the name of it, right?

2:11So what's that command?

2:12Conda, conda env list.

2:16And okay, so mine is Pandas, CBTN, right here.

2:20So that's what I'm gonna use.

2:22So I'm just gonna copy that and say conda activate.

2:26So that's the answer, right?

2:28Because I don't know, well activate

2:31because I don't know what the name of your command is.

2:33So, and there's some also some, you know,

2:37some clearly wrong answers in the questions as well.

2:40So this is how you activate it.

2:41Let's go ahead and do that.

2:42Okay, cool. That is the first question.

2:45Second question, how do you launch Jupyter Notebook?

2:49Okay, so there's one that's kind of funny,

2:54it's not this, right?

2:58It's, and it's not even conda.

3:00this is a correct answer, right?

3:05And if I hit that,

3:06then that would actually open Jupyter Notebook

3:08and we're not gonna do that.

3:09But that is the correct answer.

3:11And the reason I added this

3:13is because that's the name of the package, right?

3:16So this is what,

3:18if you're installing it, that's what it would be.

3:20So let's say conda list.

3:23And this should show us all of our packages.

3:26And if you look here, that's Jupyter Notebook.

3:29So that's why I kind of put that there to throw you off.

3:31But it's also good, I think a good learning opportunity

3:35because that's the name of the package, right?

3:36So it's kind of good to know,

3:38but the actual command is Jupyter Notebook.

3:42Alright, let's go to the next question.

3:45So how do you deactivate a conda environment?

3:48Well, first of all, let me clear this up.

3:49This is a lot of information, okay?

3:51So I can tell that I'm in my, whoops,

3:54I'm in my activated conda environment,

3:58simply gonna write conda, deactivate.

4:05If I hit that, then I'm back into my base environment.

4:09And so that's the correct answer.

4:11And so what is the next one?

4:12Does pandas have documentation?

4:15The answer is true because yes, it does have documentation.

4:19It is right here at pandas.pidata.org.

4:26Okay, and the next question is, does pandas have a GUI,

4:30a graphical user interface like Excel and Google Sheets?

4:34And the answer there is no.

4:37And the reason for that is that is

4:42well, I mean that should be pretty straightforward.

4:44But if it's not, let's go ahead

4:46and check out an example of pandas.

4:51So let's say we can go to this,

4:56I don't know, let's go to the documentation.

4:58So I'm gonna click this

4:59and I'm just gonna enter, I think,

5:01let's say data frame.

5:08Alright, so here's a pandas data frame

5:10and we'll scroll down and we'll see an example.

5:12So Pandas kind of looks like this.

5:14So that's not a GUI, graphical user interface.

5:17That's basically a code cell where you type code.

5:20So the answer is false.

5:23Okay, next question.

5:25Is Pandas open source?

5:27If you don't know the answer to that,

5:29then you can just come here

5:31and you can see that it is open source clearly.

5:35So the answer for that one is true.

5:39But what happens if you're working with pandas

5:42and you don't know the answer to something,

5:44and maybe I'm not explicitly addressing that in the videos,

5:49that could very well be the case

5:50because I can't cover everything.

5:52So I'm gonna share something very important with you.

5:55And if you're a programmer,

5:56have a programming background,

5:58you probably probably already know about Stack Overflow,

6:02but if not, this Stack Overflow is your friend.

6:07Let me show you what I mean.

6:09To get there, all you have

6:10to do is come to the pandas documentation,

6:13so pandas.piata.org, and you just go to ask a question

6:19and it automatically takes you to Stack Overflow.

6:22So I would definitely suggest getting,

6:24creating an account here, going to sign up

6:27and just having an account because you can ask questions.

6:30So let's go ahead and do that together.

6:33Maybe we'll do a conda question.

6:34Let's see.

6:36So this says Pandas here, right?

6:38So maybe I can ask a question.

6:41I'll just leave it there and I'll say,

6:46activate conda environment.

6:53I'm not a robot.

6:55Okay, so what happens, let's see,

6:58other conda environments do not activate,

7:01couldn't import missing dependencies.

7:07To be quite honest, this is too easy.

7:10(laughing)

7:13So what do I mean by that?

7:13Well, I think that there's gonna be some things

7:17that you want to look for

7:19and you'll know where to go for like a cheat sheet

7:22or the documentation versus Stack Overflow.

7:24So let me dive into that

7:25and kind of give you like a quick rundown of how to do that.

7:28So first the answer is right here, right?

7:31If you click on this, it's not a great question,

7:34but if you click on this you, it was kind of highlighted

7:37that you could use that.

7:38So if I manually type conda activate pandas, it'll work.

7:45Well that kind of sort of works.

7:47But I wanna share this with you.

7:48This is the conda cheat sheet.

7:50And if, how do you find this?

7:53Well, it's here in the conda or the docs.conda.io.

7:58And I think if you just type in cheat sheet,

8:03we should be able to get that.

8:06♪ Do do do ♪

8:08Is that it? Let's try it.

8:17No, but this is pretty cool

8:18because it has, I mean you could actually just

8:23look through the documentation.

8:25Oh there it is. Cheat sheet.

8:26I kind of like the cheat sheet

8:27because it has everything there

8:28and if you click on it, it just downloaded it for me.

8:32So let me just go back to where I had it sort of.

8:37I think it was here.

8:38One more, there we go.

8:39So I already had it opened up, so let's go ahead

8:41and zoom into this.

8:45There.

8:46Alright, so conda info is pretty cool,

8:48so let's check that out.

8:49So what is conda info?

8:55Wow, so a lot of information version, numbers, build,

9:00directories, base environment,

9:04directories.

9:06Cool, so a lot of information,

9:10I think this might be useful,

9:11maybe a little bit, not useful right now.

9:13So let's check something else out conda update.

9:16So you could update that way.

9:18You can conda install and then package name.

9:20That's what we did when we installed Jupyter Notebook,

9:23Pandas, NumPy and Matplotlib.

9:25So that's cool.

9:28You can update a package as well.

9:30And then you can do help.

9:32So this is kind of awesome.

9:34So conda, let's see what we could do.

9:37Conda update or command name and then help.

9:40Let's try that.

9:41So let's say you're trying to install,

9:43so like conda install --help

9:51Scroll all the way up to the top,

9:54it's a lot of information.

9:55So here's where it begins.

9:58So conda install

10:00and then here are all of the different commands

10:02that you can use.

10:03So path, channel, I mean it's a lot of information.

10:10This is sort of like the documentation built

10:12into the terminal or the conda prompt.

10:16So that's kind of cool.

10:17It's a lot of information,

10:18but I thought I'd take this opportunity

10:19to kinda show you this.

10:20And here's conda create,

10:24conda env list.

10:25Remember we used that one already and we can do conda list.

10:29We did that too.

10:30And what does conda list do?

10:32So let's go ahead and clear this.

10:33So we know that conda env list

10:36will list the the environments.

10:38And what does conda list do?

10:39Well it's packages, right?

10:41I was looking to see what Jupyter Notebook is called

10:44and that's what I used.

10:45There's also seaborne

10:49and well there's a lot of 'em here.

10:50Why is that?

10:53Okay, because I am in my base environment.

10:56So this is, I'm glad I made that mistake.

10:59If you say conda list, it's gonna show all the packages

11:02that you have in your project,

11:04but the base environment has all of them.

11:06So this is not gonna work.

11:08So I'm gonna activate it and then say conda list.

11:11So let's try that out.

11:14Okay, so up arrow allows me

11:16to go through all the previous commands that I entered.

11:20So that's conda, activate pandas_cbtn.

11:24Now I'm in my conda environment,

11:27so I'm gonna say conda list.

11:31Okay, much shorter list, still a lot,

11:34but you can see that notebook is here

11:36and that's what I did last time.

11:37So conda list, really great command,

11:41very useful for where we're at right now

11:43in our journey with Pandas.

11:46And so what else?

11:50Conda env create, we already did that,

11:52conda search PACKAGENAME, you can do that.

11:55See a list of all packages,

11:57well that's a URL.

11:59Conda install jupyter.

12:01Cool, we already did that.

12:06And you might notice

12:07that there's slight differences in syntax.

12:09I'm able to get it to work without using a dash

12:12like jupyter-notebook.

12:14I'm able to just say Jupyter Notebook

12:15with a space and that works.

12:16So this important to sort of mention that

12:20there may be slight variations in syntax.

12:23For example, right here it says conda create name.

12:28And then once you create that, you say activate

12:31in that you don't have to say conda activate.

12:33That's interesting.

12:33Let's see if that works.

12:35So I'm gonna deactivate

12:40and I'm gonna just say activate pandas_cbtn.

12:48I gotta spell pandas correctly

12:52and that didn't work for me.

12:54So let's look at that.

12:56So what did, oh that's for Windows.

13:01For Linux it says source activate.

13:05Okay, well for me it's conda.

13:07So let's do source activate.

13:13Okay, you could do that.

13:14But look, if I, just to make my point,

13:17you can actually do this.

13:21Conda activate and it works.

13:24So I was able to use source activate pandas

13:28and then the name or conda activate pandas, you know CBTN.

13:32So either one works.

13:33So there's a little bit of slight differences in the syntax,

13:36which I think is super interesting.

13:40Alright, so that's a lot of great stuff.

13:42So I hope this was useful.

13:44I hope I answered the questions and a little bit more.

13:47Again, the documentation is awesome, it's really helpful.

13:50And the conda cheat sheet

13:52when you're first getting started, it's a great resource.

13:54So you can download that and it's free

13:57and it's on docs.conda.io.

14:02So let me share that.

14:03Let me just show you that real quick.

14:09And I think if you just type cheat sheet here

14:12and that's how you would get there.

14:15Let's see.

14:21Getting started and I think it was right here.

14:23Yeah, there it is.

14:24And if you click on that, that's gonna download it.

14:27I hope this has been informative

14:28and I'd like to thank you for viewing.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Request a Demo

Just need Python Pandas for Data Manipulation? Enroll from $300/yr (20 skills)

Request a Demo