Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
How to slice a dataframe with list comprehension by using

###this is question ###By using a list comprehension (or any other technique other than looping), I want to create a list list_ex that contains those slices of dfx in which the consecutive exercise is the same as the current exercise. As soon as the consecutive exercise is not the same as the one in the current row, the next dataframe slice begins. With respect to the example, that means that list_ex should contain 5 dataframes:

   var mdMongo = new MetadataMongo();
   var listWrites = new List<WriteModel<MetadataMongo>>();
   foreach(var val in data){
   mdMongo.ID = val.ID;
   mdMongo.Type = val.TableTypes.Media;
   mdMongo.TemplateType = val.TemplateType;
   mdMongo.Output = val.Output;
        mdMongo.IsMasterPage = val.IsMasterPage;
        mdMongo.StartDate = val.StartDate;
        mdMongo.EndDate = val.EndDate;
        mdMongo.UpdatedOn = val.UpdatedOn;
        mdMongo.CompanyID = val.CompanyID;
        mdMongo.CreatedBy = val.CreatedBy;
        mdMongo.Rating = val.Rating;

        var filters = Builders<MetadataMongo>.Filter.Eq("Id", mdMongo.Id);
        var update = updateDefination.Add(Builders<MetadataMongo>.Update.Set(mdMongo);
        var updateRecords = new UpdateOneModel<MetadataMongo>(filters, update) { IsUpsert = false };
        listWrites.Add(updateRecords );
    }
    await userCollection.BulkWriteAsync(listWrites);    
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda