摘要:
import pandas as pd df = pd.DataFrame({"month": [1, 4, 7, 10], "year": [2012, 2014, 2013, 2014], "sale": [55, 40, 84, 31]}) new_df = df.set_index(["year", "month"]) print(new_df.index.names) print(new 阅读全文
摘要:
运行结果: 阅读全文
摘要:
存储文件内容 阅读全文
摘要:
import pandas as pd import numpy as np data = pd.read_csv("./data/test.csv") print(data) print(pd.isnull(data)) # 缺失值True,其他False print(np.any(pd.isnull(data))) # 有缺失值True,没有False print(np.... 阅读全文
摘要:
import pandas as pd data = pd.Series([176, 174, 160, 180, 159, 163, 192, 184], index=["No1:176", "No2:174", "No3:160", "No4:180", "No5:159", "No6:163", "No7:192", "No8:184"]) print... 阅读全文