https://www.data.gouv.fr/api/1/datasets/r/4d741143-8331-4b59-95c2-3b24a7bdbe3c
Note Direct access to the course: cours
This quick course introduces fundamentals of Data Vizualization with Python. Its basics components are:
- Matplotlib: provides the tools to make any (static) chart, on which the following are based
- Seaborn: based on Matplotlib, provides shortcuts for attractive charts, along with additional ready to use graphs (e.g. pairplot)
- Plotly: based on Seaborn, provides interactivity with labels and zoom level, along with additional ready to use graphs (e.g. sunburst)
- Streamlit: provides interactivity with the user as in any dashboard (Tableau Software, Power BI)
The objective of this workshop is to transition from static data analysis to interactive web applications, ensuring reproducibility and ease of sharing within the scientific community.
We will use a cloud-based development environment to avoid local installation issues.
To modify the source code and save your progress, you must first create a personal copy of this repository on your GitHub account.
- Navigate to the top-right corner of this page.
- Click on the Fork button.
- Confirm by clicking Create fork.
Note: You now possess a personal copy of the repository (
your-username/repository-name). All subsequent operations must be performed on this version.
We will utilize a pre-configured cloud environment (Codespace) that contains all necessary dependencies (Python, Pandas, Plotly, Streamlit).
- Click on the green Code button.
- Select the Codespaces tab.
- Click on Create codespace on main.
A Visual Studio Code interface will open in your browser. Please allow a few minutes for the environment to initialize fully.
Once the terminal (the command line interface at the bottom of the screen) is ready, execute the following command to start the Streamlit server:
python -m streamlit run app.pyA notification will appear in the bottom-right corner. Click Open in Browser to view the dashboard.
If the notification does not appear, navigate to the Ports tab (next to the Terminal tab) and click on the "Globe" icon to access the application.
You may now modify the app.py file to alter the visualization parameters or add new charts. Once your changes are complete, you must push them to your GitHub repository.
Execute the following commands sequentially in the terminal:
- Stage the changes:
git add app.py- Commit the changes with a descriptive message:
git commit -m "Updated visualization parameters"- Push the changes to the remote repository:
git pushOr simply ask the AI agent (Claude) to do it for you!
Authentication: If this is your first commit from a Codespace, Git may prompt you to authorize the connection. Please follow the on-screen instructions.
To make your dashboard accessible to collaborators via a public URL, we will deploy it using Streamlit Community Cloud.
- Open a new tab and navigate to share.streamlit.io.
- Click on Continue with GitHub.
- Simply click Authorize streamlit at the bottom of the page.
- Click on New app.
- Select Use existing repo.
- In the repository dropdown menu, select your forked repository.
- Click Deploy!.
This course has been made originally for UPEC (Université Paris Est Créteil) located in France in the Paris area. It is expected to be taught in a 1 day workshop with 3 hours of lectures and 4 hours of exercises.
Coucou (alexis)
coucou (llm)