Hướng dẫn dùng pct_change 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. Pandas Note : This function is mostly useful in the time-series data.
Example #1: Use
Let’s use the Output
: The first row contains NaN values, as there is no previous row from which we can calculate the change.Example #2: Use pct_change() function to find the percentage change in the data which is also having NaN values.
Output : The first row contains |