![]() |
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. Python
To download the data set used in following example, click here. Example #1: Subtracting List In this example, the top 5 rows are stored in new variable using .head() method. After that a list of same length is created and subtracted from the salary column using .sub() method
Output: Example #2: Adding series to series with null values In this example, the Age column is subtracted from the Salary column. Since the salary column contains null values too, by default it returns NaN no matter what is subtracted. In this example, 20 is passed to replace null values with 20.
Output: |
Reffered: https://www.geeksforgeeks.org
Python |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |