Show the code
import pandas as pd
import numpy as np
import plotly.express as px
from lets_plot import *
LetsPlot.setup_html()
Course DS 250
Gabriel Guerrero
Objective: Preparation, and first example
Set up
and questions are included in this project .
This project aims to explore the different tools for future projects and also the use of markdown and Quarto for reports and documents. It will also use and explore the Python libraries pandas
, numpy
, and plotly
.
Finish the Course Setup, and post any questions to getting your environment working smoothly in your course Slack channel
I finished the Course Setup and I posted a question on Slack.
Recreate the example chart from PY4DS: CH2 Data Visualization of the textbook
(
ggplot(data=penguins, mapping=aes(x="flipper_length_mm", y="body_mass_g"))
+ geom_point(mapping=aes(color="species", shape="species"))
+ geom_smooth(method="lm")
+ labs(
title="Body mass and flipper length",
subtitle="Dimensions for Adelie, Chinstrap, and Gentoo Penguins",
x="Flipper length (mm)",
y="Body mass (g)",
color="Species",
shape="Species",
)+
theme(plot_title=element_text(color='black', size=18, face='bold'))
)
Penguins
Include the table created from PY4DS: CH2 Data Visualization used to create the above chart
This is the table created from PY4DS.
| | species | island | bill_length_mm | bill_depth_mm | flipper_length_mm | body_mass_g | sex | year |
|---:|:----------|:----------|-----------------:|----------------:|--------------------:|--------------:|:-------|-------:|
| 0 | Adelie | Torgersen | 39.1 | 18.7 | 181 | 3750 | male | 2007 |
| 1 | Adelie | Torgersen | 39.5 | 17.4 | 186 | 3800 | female | 2007 |
| 2 | Adelie | Torgersen | 40.3 | 18 | 195 | 3250 | female | 2007 |
| 3 | Adelie | Torgersen | nan | nan | nan | nan | nan | 2007 |
| 4 | Adelie | Torgersen | 36.7 | 19.3 | 193 | 3450 | female | 2007 |
| 5 | Adelie | Torgersen | 39.3 | 20.6 | 190 | 3650 | male | 2007 |
| 6 | Adelie | Torgersen | 38.9 | 17.8 | 181 | 3625 | female | 2007 |
| 7 | Adelie | Torgersen | 39.2 | 19.6 | 195 | 4675 | male | 2007 |
| 8 | Adelie | Torgersen | 34.1 | 18.1 | 193 | 3475 | nan | 2007 |
| 9 | Adelie | Torgersen | 42 | 20.2 | 190 | 4250 | nan | 2007 |