df.head () czasami nie działa w Pandas, Python

Jestem początkującym w Pythonie i bibliotece Pandas i jestem raczej zdezorientowany przez niektóre podstawowe funkcje DataFrame. Mam pandę DataFrame jak poniżej:

>>>df.head()  
              X  Y       unixtime
0  652f5e69fcb3  1  1346689910622
1        400292  1  1346614723542
2  1c9d02e4f14e  1  1346862070161
3        610449  1  1346806384518
4        207664  1  1346723370096

Jednak po wykonaniu pewnych funkcji:

def unixTodate(unix):
  day = dt.datetime.utcfromtimestamp(unix/1000).strftime('%Y-%m-%d')
  return day

df['day'] = df['unixtime'].apply(unixTodate)

Nie mogłem już korzystać z funkcji df.head ():

>>>df.head()  

<class 'pandas.core.frame.DataFrame'>
Int64Index: 5 entries, 190648 to 626582
Data columns:
X              5  non-null values
Y              5  non-null values
unixtime       5  non-null values
day            5  non-null values
dtypes: int64(3), object(5)

Nie rozumiem, dlaczego tak się dzieje. Czy robię tu coś złego? Każdy wskaźnik jest mile widziany! Dzięki.

questionAnswers(3)

yourAnswerToTheQuestion