(Jun-02-2024, 08:07 PM)S2G Wrote: or "Print the moons in alphabetic order"Just to give help with this task,it's the same start for the other task as you use DataFrame
sat_df
.It's a typically dataset to be used with Pandas,you should mention what to use.
As regulars Python and Pandas are quite different.
import pandas as pd file = 'satellites.csv' sat_df = pd.read_csv(file) # Sort the moons alphabetically moons_sorted = sat_df.sort_values(by='name') print(moons_sorted[['planet', 'name']])
Output: planet name
17 Jupiter Adrastea
93 Saturn Aegaeon
107 Saturn Aegir
33 Jupiter Aitne
101 Saturn Albiorix
.. ... ...
133 Uranus Titania
151 Uranus Trinculo
158 Neptune Triton
132 Uranus Umbriel
94 Saturn Ymir
[177 rows x 2 columns]