This shows you the differences between two versions of the page.
ep:labs:061 [2020/11/18 11:49] ioan_adrian.cosma [Contents] |
ep:labs:061 [2023/10/07 21:54] (current) emilian.radoi [[10p] Feedback] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Objectives ===== | ===== Objectives ===== | ||
- | * Conditional plotting | + | * Introduction to pandas |
- | * Time-based data when plotting in gnuplot | + | * Easy data manipulations with pandas |
- | * Advanced plotting concepts: Histograms, animations, heatmaps, three-dimensional plots | + | * Introduction to seaborn |
- | * Insertion of graphics in the .tex file | + | * More types of cool looking plots with seaborn |
+ | * Apply what you learned on exploring COVID data for Romania | ||
- | ===== Introduction ===== | + | ===== Resources ===== |
- | A quick plot is enough when you are exploring a data set or a function. But when you present your results to others you need to prepare the plots much more carefully so that they give the information to someone who does not know all the background you do. | + | In this lab, we will study the basic API of pandas for easier data manipulations, and seaborn for some more advanced and visually appealing plots that are also easy to produce. |
- | **Using PostScript plots with LaTeX** | + | For the exercises, you will explore the evolution of the COVID pandemic in Romania, using the information learned in this lab. |
- | - Make sure all the individual image files are properly trimmed EPS files. | + | For scientific computing we need an environment that is easy to use, and provides a couple of tools like manipulating data and visualizing results. We will use Google Colab, which comes with a variety of useful tools already installed. |
- | - Create a LaTeX document. | + | |
- | - Process this document using LaTeX. | + | |
- | - Use the dvips utility with the -E flag to turn the resulting DVI file into Encapsulated PostScript. | + | |
- | ===== Cheatsheet ===== | + | Check out these cheetsheets for fast reference to the common libraries: |
- | <code> | + | **Cheat sheets:** |
- | scatter plot: | + | |
- | plot ’dataset.txt’ using 1:2 | + | |
- | plot ’dataset.txt’ using 1:2 with points | + | |
- | example for the short format: | + | - [[https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf)|python]] |
- | p ’dataset.txt’ u 1:2 w p pt 1 lt 2 lw 2 | + | - [[https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Numpy_Python_Cheat_Sheet.pdf|numpy]] |
- | notitle | + | - [[https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Python_Matplotlib_Cheat_Sheet.pdf|matplotlib]] |
+ | - [[https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Scikit_Learn_Cheat_Sheet_Python.pdf|sklearn]] | ||
+ | - [[https://github.com/pandas-dev/pandas/blob/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf|pandas]] | ||
+ | - [[https://s3.amazonaws.com/assets.datacamp.com/blog_assets/Python_Seaborn_Cheat_Sheet.pdf|seaborn]] | ||
- | line plot: | + | <note>This lab is organized in a Jupyer Notebook hosted on Google Colab. You will find there some intuitions and applications for pandas and seaborn. Check out the Tasks section below.</note> |
- | plot ’dataset.txt’ using 1:2 with lines | + | |
- | multiple data series: | + | ===== Tasks ===== |
- | use replot or separate by commas | + | |
- | plot ’dataset.txt’ using 1:2, ’data.csv’ using 1:3 | + | |
- | set key: | + | ==== Google Colab Notebook ==== |
- | plot ’dataset.txt’ using 1:2 title "key" | + | |
- | </code> | + | |
- | ===== Tutorial ===== | ||
- | Datafile: {{:ep:labs:dataset.txt|}} | + | For this lab, we will use Google Colab for exploring pandas and seaborn. Please solve your tasks [[https://github.com/cosmaadrian/ml-environment/blob/master/EP_Plotting_II.ipynb|here]] by clicking "**Open in Colaboratory**". |
- | {{namespace>:ep:labs:061:contents:tutorial&nofooter&noeditbutton}} | + | You can then export this python notebook as a PDF (**File -> Print**) and upload it to **Moodle**. |
- | ===== Tasks ===== | + | ==== [10p] Feedback ==== |
- | {{namespace>:ep:labs:061:contents:tasks&nofooter&noeditbutton}} | + | Please take a minute to fill in the **[[https://forms.gle/NpSRnoEh9NLYowFr5 | feedback form]]** for this lab. |