似乎没有关于如何在单列熊猫操作中使用 hy 的文档,如下所示。将不胜感激任何帮助:
# simple instantiation to scalar
df['a'] = '2'
# the above can be done like so: (-> df (.assign :a "2")) but would appreciate any better ways
# cast a column to int
df['a'] = df['a'].astype(int)
# creating derived columns
df['c'] = df['a'] + df['b']
#subsetting by columns
dd = df[['a','b']]
#subsetting by criteria
dd = df[(df['a'] > 1) & (df['b'] < 2)]