ML code error :unsupported operand type(s) for -: 'DatetimeIndex' and 'datetime.date' [on hold]












0












$begingroup$


I am getting the above mentioned error for the code given below



import numpy as np



import pandas as pd



import matplotlib.pyplot as plt



import seaborn as sns



%matplotlib inline



media = pd.read_csv('mediacompany.csv')



media = media.drop('Unnamed: 7',axis = 1)



media.head()



media['Date'] = pd.to_datetime(media['Date'])



media.head()



from datetime import date



d0 = date(2017, 2, 28)



d1 = media.Date



delta = d1 - d0



they point out the error to be in last line of code i.e delta = d1 - d0










share|improve this question









New contributor




rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$



put on hold as off-topic by Stephen Rauch 11 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question does not appear to be about data science, within the scope defined in the help center." – Stephen Rauch

If this question can be reworded to fit the rules in the help center, please edit the question.





















    0












    $begingroup$


    I am getting the above mentioned error for the code given below



    import numpy as np



    import pandas as pd



    import matplotlib.pyplot as plt



    import seaborn as sns



    %matplotlib inline



    media = pd.read_csv('mediacompany.csv')



    media = media.drop('Unnamed: 7',axis = 1)



    media.head()



    media['Date'] = pd.to_datetime(media['Date'])



    media.head()



    from datetime import date



    d0 = date(2017, 2, 28)



    d1 = media.Date



    delta = d1 - d0



    they point out the error to be in last line of code i.e delta = d1 - d0










    share|improve this question









    New contributor




    rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$



    put on hold as off-topic by Stephen Rauch 11 hours ago


    This question appears to be off-topic. The users who voted to close gave this specific reason:


    • "This question does not appear to be about data science, within the scope defined in the help center." – Stephen Rauch

    If this question can be reworded to fit the rules in the help center, please edit the question.



















      0












      0








      0





      $begingroup$


      I am getting the above mentioned error for the code given below



      import numpy as np



      import pandas as pd



      import matplotlib.pyplot as plt



      import seaborn as sns



      %matplotlib inline



      media = pd.read_csv('mediacompany.csv')



      media = media.drop('Unnamed: 7',axis = 1)



      media.head()



      media['Date'] = pd.to_datetime(media['Date'])



      media.head()



      from datetime import date



      d0 = date(2017, 2, 28)



      d1 = media.Date



      delta = d1 - d0



      they point out the error to be in last line of code i.e delta = d1 - d0










      share|improve this question









      New contributor




      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      I am getting the above mentioned error for the code given below



      import numpy as np



      import pandas as pd



      import matplotlib.pyplot as plt



      import seaborn as sns



      %matplotlib inline



      media = pd.read_csv('mediacompany.csv')



      media = media.drop('Unnamed: 7',axis = 1)



      media.head()



      media['Date'] = pd.to_datetime(media['Date'])



      media.head()



      from datetime import date



      d0 = date(2017, 2, 28)



      d1 = media.Date



      delta = d1 - d0



      they point out the error to be in last line of code i.e delta = d1 - d0







      machine-learning python anaconda






      share|improve this question









      New contributor




      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 7 mins ago







      rosh













      New contributor




      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 12 hours ago









      roshrosh

      12




      12




      New contributor




      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      rosh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      put on hold as off-topic by Stephen Rauch 11 hours ago


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "This question does not appear to be about data science, within the scope defined in the help center." – Stephen Rauch

      If this question can be reworded to fit the rules in the help center, please edit the question.







      put on hold as off-topic by Stephen Rauch 11 hours ago


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "This question does not appear to be about data science, within the scope defined in the help center." – Stephen Rauch

      If this question can be reworded to fit the rules in the help center, please edit the question.






















          0






          active

          oldest

          votes

















          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Ponta tanko

          Tantalo (mitologio)

          Erzsébet Schaár