filmov
tv
Working with Pandas: head, tail, slice & subset, add & remove columns
Показать описание
In this video you will be introduced to working with Pandas dataframes:
1) We will work with pandas head & tail
2) Select columns, subset Pandas dataframes, and slice frames.
3) Add an empty column and calculate a mean score of two columns (mean of the rows in two columns).
This video is an introduction to working with Pandas dataframe. As summarized above we will learn how to work with Pandas dataframe. More specifically, we will use head & tail to check the first x and last x rows of a dataframe. We will then continue with selecting columns of a dataframe.
After we have selected columns, using two methods, we will go on and subset the dataframe using Pandas query(), and another method. Both methods are quit similar to the subset function of R. We will filter rows in a Pandas dataframe based on a single value as well as multiple values.
When we have done the slicing/subsetting of the dataframe we will learn how to add an empty column. Adding empty columns to a Pandas dataframe can be useful if you want to add values later, for instance. Finally, we will also add a column that is based on two other columns in the dataframe. That is, we will calculate a mean value of to columns and add these values to a new column. The calculation of row means are done using two methods; first by just adding row value and substracting it by two. Second, we use the mean() method from the Pandas dataframe.
» Pandas Documentation:
Other great videos about working with Pandas dataframe:
» How to install Pandas:
» Creating dataframes (empty, from dictionaries, and arrays):
» How to read Excel files using Pandas read_excel:
1) We will work with pandas head & tail
2) Select columns, subset Pandas dataframes, and slice frames.
3) Add an empty column and calculate a mean score of two columns (mean of the rows in two columns).
This video is an introduction to working with Pandas dataframe. As summarized above we will learn how to work with Pandas dataframe. More specifically, we will use head & tail to check the first x and last x rows of a dataframe. We will then continue with selecting columns of a dataframe.
After we have selected columns, using two methods, we will go on and subset the dataframe using Pandas query(), and another method. Both methods are quit similar to the subset function of R. We will filter rows in a Pandas dataframe based on a single value as well as multiple values.
When we have done the slicing/subsetting of the dataframe we will learn how to add an empty column. Adding empty columns to a Pandas dataframe can be useful if you want to add values later, for instance. Finally, we will also add a column that is based on two other columns in the dataframe. That is, we will calculate a mean value of to columns and add these values to a new column. The calculation of row means are done using two methods; first by just adding row value and substracting it by two. Second, we use the mean() method from the Pandas dataframe.
» Pandas Documentation:
Other great videos about working with Pandas dataframe:
» How to install Pandas:
» Creating dataframes (empty, from dictionaries, and arrays):
» How to read Excel files using Pandas read_excel:
Комментарии