Mirror Mirror Study Session 2
Key point
Learned the basics and advanced techniques of selecting, merging, and exploring CSV files with pandas through a study session.
Details
Basic Python code for handling CSV files was organized together with how to use pandas. Tasks like selecting consecutive rows, adding headers, and merging multiple files were learned by comparing basic code with the pandas approach.
- Selecting consecutive rows: In basic Python, a
forloop picks rows matching a condition and saves them withwriterow(), while pandas handles it withdropandto_csv(). - Adding headers: In basic Python,
writerow()writes the header first, while pandas handles headers using attributes ofpd.read_csv. - Combining multiple files: After building a file list with
globandos.path, basic Python reads and writes sequentially, while pandas mergessales_february_2014.csv,sales_january_2014.csv, andsales_march_2014.csvwithconcat. - Exercises: Practiced adding a new Bool-type column to filter data, and creating a new dataframe by selecting specific columns.
In the advanced session, company data was read directly with ipython notebook, and practice covered exploration, selection, sorting, manipulation, grouping, and merging. Dataframes were surveyed with df.head, df.shape, df.describe, and necessary rows and columns were selected with .iloc and .loc.
For data manipulation, participants learned how to add columns and fill values, how to replace a specific value A with B all at once, and how to write short functions using lambda. Finally, they learned the flow of computing sums and averages with groupby and combining tables with merge, confirming its practical applicability.
The study session was well balanced between book summaries, hands-on practice with company data, and live coding, providing both understanding and engagement. In particular, groupby, merge, and lambda felt useful, and it was a fresh experience to directly watch the process of debugging by following error messages. With even the pizza being delicious, the session left the impression of a great atmosphere for learning.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.