Hướng dẫn ffill python
View Discussion Improve Article Save Article View Discussion Improve Article Save Article Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much
easier. Syntax: DataFrame.ffill(axis=None, inplace=False, limit=None, downcast=None) Example #1: Use ffill() function to fill the missing values along the index axis. Python3
Let’s fill the missing value over the index axis Python3Output : Notice, values in the first row is still NaN value because there is no row above it from which non-NA value could be propagated. Example #2: Use ffill() function to fill the missing values along the column axis. Python3
Let’s fill the missing value over the column axis Python3Output :
Notice, the value in the first column is NaN value because there is no cell left to it and so this cell cannot be filled using the previous cell value along the column axis. |