(self,com='read',exce=100001,n=10, asc=0, mov='main')
return df2.loc[df2.index[0:n]]
返回指定字段最高或最低的n行
返回指定字段最高或最低的n行
返回指定字段最高或最低的n行
def getNumNExcept(self,com='read',exce=100001,n=10, asc=0, mov='main'):
        '''
        返回指定字段最高或最低的n行
        '''
        df = self.posts_df.loc[self.posts_df[com] != exce]
        if mov=='main':df = df.loc[df['mov']==10]
        # 按照阅读量进行降序排序
        df2 = df.sort_values([com],ascending=asc)
        return df2.loc[df2.index[0:n]]
def getNumNExcept ( self , com = 'read' , exce = 100001 , n = 10 , asc = 0 , mov = 'main' ) : df = self . posts_df . loc [ self . posts_df [ com ] != exce ] if mov == 'main' : df = df . loc [ df [ 'mov' ] == 10 ] # 按照阅读量进行降序排序 df2 = df . sort_values ( [ com ] , ascending = asc ) return df2 . loc [ df2 . index [ 0 : n ] ]