title: How to append column total to pandas dataframe every 4th row?
body: <p>I have the following dataframe with weekly numbers for column A, B and C:</p>
  <pre><code>week  A B C
  0     1 0 0
  1     1 0 1
  2     0 1 0
  3     1 1 1
  4     1 0 0
  5     0 0 1
  6     0 1 0
  7     1 1 1
  8     1 0 0
  9     0 0 1
  10    0 1 0
  11    1 1 1
  </code></pre>
  <p>and I want to append the dataframe with a row consisting of the monthly total for each column (so the previous 4 weeks together), with a wanted outcome something like this:</p>
  <pre><code>week   A B C
  0      1 0 0
  1      1 0 1
  2      0 1 0
  3      1 1 1
  total  3 2 2
  4      1 0 0
  5      0 0 1
  6      1 1 0
  7      2 1 0
  total  4 2 1
  8      1 0 0
  9      0 0 1
  10     0 0 0
  11     1 0 1
  total  2 0 2
  </code></pre>
  <p>I have used</p>
  <pre><code>df.groupby(df.index // 4).sum(numeric_only=True, axis=0)
  </code></pre>
  <p>to get the monthly numbers but I do not know how to get it appended in the df.
  Any ideas? Thanks</p>