-1

[Here the image] 1I dont know why i get this error. Here is the code:

import pandas as pd
import matplotlib.pyplot as plt 
import numpy as np 

data = pd.read_csv("files/ch04/ACCIDENTS_GU_BCN_2013.csv" , encoding= 'unicode_escape')
data['Date'] = data[u'Dia de mes']. apply(lambda x: str(x))
+ '-' + data[u'Mes de any']. apply(lambda x: str(x))
data['Date'] = pd.to_datetime(data['Date'])
accidents = data.groupby (['Date']).size()
print accidents.mean()
MisterMiyagi
  • 44,374
  • 10
  • 104
  • 119

2 Answers2

0

looking at the tags of your question:

if python==3 then print(arg)
-1

the problem here is that you're using Python3 which requires brackets after the print statement. So, do this : print(accidents.mean())