split

Remove the rows from pandas dataframe, that has sentences longer than certain word length

落花浮王杯 提交于 2020-08-27 06:31:25
问题 I want to remove the rows from the pandas dataframe, that contains the strings from a particular column whose length is greater than the desired length. For example: Input frame: X Y 0 Hi how are you. 1 An apple 2 glass of water 3 I like to watch movie Now, say I want to remove the rows which has the string of words with length greater than or equal to 4 from the dataframe. The desired output frame must be: X Y 1 An apple 2 glass of water Row with value 0,3 in column 'X' is removed as the