Week 10
Wrangling Data in Python
Soci—269
Module III Begins–Coding Assignment Deadline
Your first coding assignment is due by 8:00 PM on Wednesday.
Python pandas to polars–
Download the Anaconda Distribution.
You can, of course, also download Python directly from its main website.
We can use reticulate as a portal to Python from :
library(reticulate)
# Create new Anaconda directory featuring select packages:
conda_create("soci269")
# Moving forward, to use the conda environment created above, simply run:
# use_condaenv("NAME OF ENV GOES HERE")
# use_condaenv("soci269")
# Add pandas, seaborn and matplotlib to your new Anaconda (conda) environment:
conda_install("soci269", c("pandas", "seaborn", "matplotlib"))
# GENERATING PLOTS VIA SEABORN --------------------------------------------
sns <- import("seaborn")
plt <- import("matplotlib.pyplot")
# Let's generate a simple plot via seaborn:
sns$set_theme()
sns$scatterplot(x = "bill_depth_mm",
y = "bill_length_mm",
hue = "species",
data = palmerpenguins::penguins)
plt$show()Positron May Be the Future
Download the Positron IDE.
Warning
Positron is still in its infancy.
.ipynb FilesJupyter Notebooks are living, interactive (.ipynb) documents. They allow users to craft a narrative, edit and execute lines of Python or code in real time, and generate a
wide range of outputs.
We’ll be using .ipynb files and Colaboratory for Module III.

Note
The rest of today’s session will take place in Colab!
pandas to polars–Python Coding Assignment Deadline
Your first coding assignment is due by 8:00 PM tonight.
Note
The rest of today’s session will, once again, take place in Colab.
