Last Updated on May 28, 2023 by mishou
I. Running code on Google Colaboratory
1. Use sample data sets
You can find sample data sets on Google Colaboratory. You can also get some data sets from Seaborn, which is a library for creating charts.

2. Use “( )” and “\”
Using parentheses and slashes makes the code easy to read.
Example 1
The following code is not friendly to read:
df.filter(['english', 'nationality']).groupby(by='nationality').mean().sort_values(by='english', ascending=False).plot.bar()
Use parentheses:

Example 2
The following code is not friendly to read:
df.sketch.howto('group by nationality and show the averages of english by nationality and create bar charts of the averages using pandas.')
Use slashes to break lines:

II. Running code on your computer
1. Use Pipenv
I recommend you use Pyenv to manage Python versions and create virtual environments. You can install libraries by running simple commands like Pip. For example, you can install Pandas by running ‘pipenv install pandas‘. You can learn about Pipenv here:
https://github.com/pypa/pipenv#usage
Using Pipenv
1.Make a new directory for your project and move to the directory by running the following command:
mkdir PROJECTNAME && cd PROJECTNAME
2.Create a virtual environment for the project by running the following command:
pipenv --python 3.9
3.Activate the virtual environment by running the following command:
pipenv shell
4.Install a library
pipenv install pandas

To be continued.