Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Suma acumulada mismo mes

¿Cuál es la mejor manera de tener un total acumulativo de valores de datos cuando el "mes" en la columna de fecha es el mismo? ¿Se puede hacer esto usando resample() + sum()?

Estoy pensando que probablemente pueda usar algo listo para usar en python en lugar de crear una función personalizada.

Querer:

 Input: Value Date 2015-01-01 1 2014-01-01 2 2017-03-01 3 2015-04-01 4 2016-03-01 5 Output: Value Month January 3 March 8 April 4

¡Gracias!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Preferiría un enfoque más directo con index.month_name :

 df.groupby(df.index.month_name()).sum()
over 4 years ago · Santiago Trujillo Report

0

En tu caso, esto te puede ayudar.

 out = df.groupby(df.index.strftime('%b')).sum()

producción:

 Value Date Apr 4 Jan 3 Mar 8
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!