Pandasmonium, Day 2
2025-10-20
pd.Series(), pd.DataFramedf
pd.DataFrame({ column_name : [value_1, value_2] })pd.DataFrame(dict)pd.concat([series_1, series_2], axis=1)pd.DataFrame.from_dict(dict, orient="index", columns=[dict_value])pd.DataFrame(list(dict.items()), columns=[key, value])pd.DataFrame({ ... }), create the following table| Root | Meaning | Latin | Greek | English |
|---|---|---|---|---|
| *bʰer- | ‘to carry’ | ferō | pʰérō | bear |
| *ĝenh₁- | ‘to beget’ | gignō | gígnomai | kin |
| *ped- | ‘foot’ | pēs | poús | foot |
| *doh₃- | ‘to give’ | dō | dídōmi | donate |
pd.head(), .tail(), .shape, .columns, and .index do?.Series() using df[ ]df[[ ]]df.iloc
df.loc.iloc with specific coordinates& (and) and | (or)~ in front of the filter to mean notdf alphabetically by a specific .Series(), use the method .sort_values().Series() using the .sum() methodint using int():import pandas as pd
eng_vowels = pd.DataFrame({
"symbol": ["i", "ɪ", "e", "ɛ", "æ", "u", "ʊ", "o", "ɔ", "ɑ", "ʌ", "ə"],
"height": [], #choose from "high", "mid", and "low"
"backness": [], # choose from "front", "back", and "central"
"tense": [], #choose from True or False
"rounded": [], #choose from True or False
})
eng_vowelsFilter the df: show only high back rounded vowels
Negation and slicing: display all vowels that are not tense.
Then display only the first three vowels of that group.
Sort the df by height and backness.
Count how many vowels are rounded, tense and both.