development:python:pandas
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:python:pandas [2024/11/09 17:12] – [7. Others] tungnt | development:python:pandas [2024/11/19 14:41] (current) – [5. Group/Sort Data] tungnt | ||
---|---|---|---|
Line 260: | Line 260: | ||
df_groups = df.groupby([' | df_groups = df.groupby([' | ||
+ | |||
+ | df_ut_groups = df_ut_trans.groupby([' | ||
+ | |||
df_groups.sort_values(by=' | df_groups.sort_values(by=' | ||
Line 371: | Line 374: | ||
print(df_combined) | print(df_combined) | ||
</ | </ | ||
+ | |||
+ | ===== Xóa nhiều bản ghi cùng lúc ===== | ||
+ | |||
+ | < | ||
+ | # Xóa các dòng có index là 1 và 3 | ||
+ | df = df.drop(index=[1, | ||
+ | |||
+ | # Xóa các dòng có id là 1 và 3 | ||
+ | df = df[~df[' | ||
+ | </ | ||
development/python/pandas.1731172334.txt.gz · Last modified: 2024/11/09 17:12 by tungnt