我有一个周期为14行的数据帧,即每条记录有14行数据(means,sdev等)。我想要提取第二、第四、第七和第九行,对每条记录(14行)重复提取。我的代码是:这不起作用
TypeError: cannot do slice indexing on <class 'pandas.core.indexes.range.RangeIndex'> with these index
我想对每一行中的列进行排序,即保持行的顺序不变,但对列进行排序。下面给了我一个KeyError。import numpy as npnp.random.seed(42)
df = pd.DataFrame(np.random.normal(0, 1, (1000, n)), columns=[f"x{i}" for i in range(