1. Home
  2. Docs
  3. Python-DataScience
  4. Data Manipulate with Pandas
  5. Manipulation with Index

Manipulation with Index

Efficiently manipulate data with index operation

利用index快速定位,排序

高阶应用举例

.all()和.any()命令

np.array.any()是操作,任意一个元素为True,输出为True。
np.array.all()是操作,所有元素为True,输出为True

Dict 与 DataFrame异同

dict的储存为(type, keys, values)

Erase Duplicates

# return bool list tells if each element is duplicated

df.duplicated()

# remove duplicated elements, leave unique ones only

df.drop_duplicates()

{eliminate duplicates-csdn}

set index

pd.set_index(keys=[KEYS_of_columns_to_be_the_new_index])

reference:

 

{pandas_index_setting-CSDN}

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.