0

I am looking for a way to create a bitmap image from a timeseries.

The timeseries is per minute for one year. It has 24x60 = 1440 entries per day.

I need a bitmap per year black and white color 365 x 1440

How to create a bitmap is clear due to this answer

My main issue is to create a matrix 1440 x 365 from a minute timeseries...

Thx

hugo

Community
  • 1
  • 1
Hugo Koopmans
  • 1,349
  • 1
  • 15
  • 27

1 Answers1

0

you can use scipy

import numpy as np

day1 = np.random.random(100)
day2 = np.random.random(100)
day3 = np.random.random(100)
day4 = np.random.random(100)


img = [day1,day2,day3,day4]



import scipy.misc
scipy.misc.imsave('outfile.bmp', np.array(img))

alternative, you can transpose it, so your data are in columns

scipy.misc.imsave('outfileT.bmp', np.array(img).T)
Mohammad Athar
  • 1,953
  • 1
  • 15
  • 31
  • Hi Mohammed, the bitmap part was already clear sory for not stating that to clearly, how to shape the one year timeseries with per minute data into a array or matrix is my challenge... i am now investigating pandas.pivot_table() – Hugo Koopmans Mar 08 '17 at 18:29