1

I'm new to pandas and was able to kill my laptop using it.

I'm using RAND's data from: https://www.rand.org/nsrd/projects/terrorism-incidents/about.html

After loading the data from a csv, I cleaned and tweaked the date column:

data["Date"]= pd.to_datetime(data["Date"])
data.head()

Which gets me: The data:

For some reason when I try to get some columns' transpose into a new df, it kills the CPU. Here's my code:

x,y,z = data["Date"].transpose(), data["Fatalities"].transpose(),data["Injuries"].transpose()
ploting_data = pd.DataFrame(x,y,z) #<- this line kills my Mac.

I know that the data is a transpose of a series, but that doesn't help much, perhaps I'm missing something. Thanks.

oba2311
  • 373
  • 4
  • 12
  • Do you need `ploting_data = data[["Date", "Fatalities", "Injuries"]].transpose()` ? – jezrael Jan 27 '18 at 08:43
  • But why need it? Because if want plot, simpliest it `data.set_index('Date')[["Fatalities", "Injuries"]].plot()` – jezrael Jan 27 '18 at 08:45

0 Answers0