3 – Pandas 3 V1

Just like we did with NumPy arrays, we can perform element-wise arithmetic operations on Pandas series. In this video, we will look at arithmetic operations between Pandas series and single numbers. Let’s create a new series that holds a grocery list of fruits. The first argument we pass in is the data, and the second … Read more

7 – Pandas 7 V1

When working with data you’ll most likely use databases from many sources. Pandas allows us to load databases of different formats into DataFrames. One of the most popular formats used to store data is CSV or comma separated values. We can load CSV files into DataFrames using the read CSV function. Let’s load Google stock … Read more

6 – Pandas 6 V1

Before we can begin analyzing data or using it to train our learning algorithms, we need to clean it. This means we need a way to detect and correct errors in our data. While any given dataset can have many types of bad data such as outliers or incorrect values, the type of bad data … Read more

5 – Pandas 5 V1

We can access elements in a DataFrame in different ways. In general, we can access rows, columns, or individual elements by using the row and column labels. Let’s see some examples. Here’s a DataFrame we created in the last video. We can access the bikes column using the column label, like this, and use a … Read more

4 – Pandas 4 V1

The second main data structure in Pandas is a DataFrame, which is a two-dimensional object with labeled rows and columns and can also hold multiple data types. If you’re familiar with Excel, you can think of a DataFrame as a really powerful spreadsheet. We can create Pandas DataFrames manually or by loading data from a … Read more

2 – Pandas 2 V1

In the last video, we created this Panda series of a grocery list. Now, how do we access or modify its elements? One great advantage of the series object, is that it allows us to access data in multiple ways. One way is accessing elements with their index labels. This accesses the quantity of eggs … Read more

1 – Pandas 1 V1

Pandas is a powerful tool for data analysis and manipulation. If you remember from the last lesson, this package is built on top of NumPy which makes it very fast and efficient. In this lesson, we will go over the two main data structures in Pandas. The Pandas series and the Panda’s dataframe. Let’s start … Read more

7 – NumPy 6 V1

Let’s see how NumPy does arithmetic operations on arrays. NumPy allows element-wise operations, as well as matrix operations. In this video, we will only be looking at element-wise operations. Consider these two rank one arrays. We can perform basic element-wise operations using arithmetic symbols or functions. Both of these forms will do the same operation. … Read more

6 – NumPy 5 V1

Up to now we’ve seen how to make slices and select elements of an NumPy array using indices. This is useful when we know the exact indices of the elements we want to select. However, there are many situations in which we don’t know the indices of the elements we want. For example; Suppose we … Read more

5 – NumPy 4 V1

As we mentioned earlier, in addition to accessing individual elements one at a time, we can access subsets of NumPy arrays with slicing. Slicing is performed by combining indices with a colon inside the brackets. In general, you will come across three ways of slicing. First, slicing from a starting index to an ending index. … Read more

4 – NumPy 3 V1

Now that you know how to create a variety of NumPy arrays, let’s see how NumPy allows us to effectively manipulate the data within them. NumPy arrays are mutable, meaning the elements in them can be changed after the array has been created. NumPy arrays can also be sliced in many different ways. This allows … Read more

3 – NumPy 2 V1

In the last video, we learnt how to create NumPy arrays by converting existing array like objects such as Python lists, using NumPy’s array function. But one great time saving feature of NumPy is its ability to generate specific kinds of NumPy arrays from nothing, using just one line of code. Here, we will see … Read more

2 – NumPy 1 V1

Generally, there are two ways to create Numpy arrays. First, using Numpy’s array function to create them from other array-like objects such as regular Python lists. And second, using a variety of built-in Numpy functions that quickly generate specific types of arrays. In this section, we will start with the first way. Let’s import Numpy … Read more

1 – NumPy 0 V1

NumPy is short for Numerical Python and is a library designed for efficient Scientific Computation. It’s built on top of the programming language C, which works at a lower level on our computer. To understand what this means for the speed of our code, see the link in the instructor notes. At the core of … Read more

1 – Jupyter

Now I’m going to introduce you to Jupyter notebooks. Notebooks are an amazing tool for data analysis, where text, code, and images all sit in one document in your browser. Here’s an example notebook where I explored predicting body fat percentage with various regression models. Up top here you see what’s called a text cell. … Read more

3-3-3-13. Glossary

Glossary Below is the summary of all the functions and methods that you learned in this lesson: Category: Initialization and Utility Function/Method Description pandas.read_csv(relative_path_to_file) Reads a comma-separated values (csv) file present at relative_path_to_file and loads it as a DataFrame pandas.DataFrame(data) Returns a 2-D heterogeneous tabular data. Note: There are other optional arguments as well that you can … Read more

3-3-3-11. Manipulate a DataFrame

book_r.py solution.py Level Up From the DataFrame above can you now pick all the books that had a rating of 5?Hint – You can do this in just one line of code, by using pandas.DataFrame.any. Try to do it yourself first, you’ll find the answer below: pandas.DataFrame.any DataFrame.any(axis=0, bool_only=None, skipna=True, level=None, **kwargs)Return whether any element is True, potentially over an … Read more