You can convert unix time to pandas' datetime using to_datetime
:
df['unix'] = pd.to_datetime(df['unix'], unit='s')
Now you can now set this as the index and resample:
df = df.set_index('unix')
df.resample('D', how={'volume': 'sum', 'price': 'last'})
Note: We're using different methods for the respective columns.
Example:
In [11]: df = pd.DataFrame(np.random.randn(5, 2), pd.date_range('2014-01-01', periods=5, freq='H'), columns=list('AB'))
In [12]: df
Out[12]:
A B
2014-01-01 00:00:00 -1.185459 -0.854037
2014-01-01 01:00:00 -1.232376 -0.817346
2014-01-01 02:00:00 0.478683 -0.467169
2014-01-01 03:00:00 -0.407009 0.290612
2014-01-01 04:00:00 0.181207 -0.171356
In [13]: df.resample('D', how={'A': 'sum', 'B': 'last'})
Out[13]:
A B
2014-01-01 -2.164955 -0.171356