摘要:
s = pd.Series(['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']) s.str.lower() # 转为小写 s.str.upper() # 转为大写 s.str.title() # 标题格式,每个单词大写 s.str.cap 阅读全文
posted @ 2024-01-28 08:18
myrj
阅读(39)
评论(0)
推荐(0)
摘要:
>>> f0=2304001 >>> xx=f0-1 >>> mvv=[] >>> muu=[] >>> muu.append([xx+1,xx+2,xx+3]) >>> muu [[2304001, 2304002, 2304003]] >>> xx=xx+3 >>> muu.append([xx 阅读全文
posted @ 2024-01-28 06:43
myrj
阅读(30)
评论(0)
推荐(0)
摘要:
目标想根据kaohao新增加一个变量,其值用来标记kaohao是否连续 解决方案: >>> df4=df3[["kaohao"]].copy()>>> df4['consecutive'] = (df4['kaohao']!= df4['kaohao'].shift(+1)).cumsum() 阅读全文
posted @ 2024-01-28 06:28
myrj
阅读(545)
评论(0)
推荐(0)

浙公网安备 33010602011771号