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

110
Views
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
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!