Skip to content
Advertisement

How to skip apply function for missing value cell in pandas

I have a Dataset as below :

JavaScript

I write the code to calculate networkdays for these row have date value in column ‘End Date’ :

JavaScript

however, I got the error below, I don’t know how I got this, could you please help look ?

my expect output like below:

JavaScript

Advertisement

Answer

I believe the problem comes from how you call the apply function.

By default, apply works on columns [1], but you can change that using the axis parameter.

Something like this might give you the expected result:

JavaScript

[1]

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement