[Data_Image_Part_1]
[Data_Imagine_Part_2]
[Column names and index name (forgot to add in image part 1]
I am trying to figure out for this data set:
How to find the major of the students whose FIDN is 30?
My idea: df_test.get_value(30, 'Major')
but I do not know if this is correct
How can I sort all the students by their last name, then by their tuition amount?
My idea: df_test.sort_values( ['LastName', 'tuition'] )
but this does not work and outputs just the column names and index name:(
df_test[df_test["FIDN"] == 30]["Major"]
OR: df_test.loc[df_test["FIDN"] == 30]["Major"]
https://stackoverflow.com/a/17071908/9169359
df_test.sort_values(by=["LastName", "tuition"], ascending=False)
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.