assign a number id for every 4 rows in pandas dataframe

I have a pandas dataframe like this: pd.DataFrame({‘week’: [‘2019-w01’, ‘2019-w02′,’2019-w03′,’2019-w04’, ‘2019-w05′,’2019-w06′,’2019-w07′,’2019-w08’, ‘2019-w9′,’2019-w10′,’2019-w11′,’2019-w12’], ‘value’: [11,22,33,34,57,88,2,9,10,1,76,14], ‘period’: [1,1,1,1,2,2,2,2,3,3,3,3]}) week value 0 2019-w1 11 1 2019-w2 22 2 2019-w3 33 3 2019-w4 34 4 2019-w5 57 5 2019-w6 88 6 2019-w7 2 7 2019-w8 9 8 2019-w9 10 9 2019-w10 1 10 2019-w11 76 11 2019-w12 14 what…

Details

show json data in ajax datatable | Ruby on Rails

Im trying to display some data that I get from an api in a datatable, but I can’t seem to get it to work. this is my view: <table id=”dt_all_tickets” class=”table table-striped” data-source=”<%= backend_dashboard_tickets_path(format: :json, redirect_controller: controller.controller_name, redirect_action: controller.action_name) %>” style=”width:100%”> <thead> <tr> <th>subject</th> </tr> </thead> the backend_dashboard_tickets_path leads to TicketsController#index this is the controller:…

Details