How to sample a dataframe or numpy array with a particular interval?

I have the following dataframe :

A   B1    B2     B3   B4    B5   B6     B7
0   0     0      0    0      0    0     0
1   444   325   479   502   630  458    588
2   1200  1255  1101  1259  1365 1400   1100
3   2092  1764  2103  2359  2245 2397   2487
4   2586  2232  2549  2597  2628 2718   2770
5   2951  2762  2924  2757  2903 2934   2963

I want to sample the columns uniformly.For examples I want to divide the interval 0 to 1 for column A as 0,0.25,0.50,0.75,1.0 and between 1 to 2 as 1,1.25,1.5 and so on... so accordingly the row values corresponding to B1, B2 etc should fit.. an arbitrary example may look like

A      B1     B2     B3   B4    B5   B6     B7
0      0      0      0    0      0    0     0
.25    96    77     102   107   114  117    110
...............................................
1      444   325    479   502   630  458    588

Basically, the coulumns should be sampled to smaller parts. Any suggestion on how to implement it would be a real help.

Topic numpy data scipy pandas statistics

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.