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

445
Views
¿Cómo escribo declaraciones de casos en Pyspark usando Palantir Foundry?

Intentando tomar una declaración de caso de macros en VBA y transferirla a Pyspark. ¿Cómo haría para escribir algo como esto en Pyspark?

 Select Case dMinutes Case 0 To 30 xnum = 1 Case 31 To 60 xnum = 2 Case 61 To 90 xnum = 3 Case 91 To 120 xnum = 4 Case Else xnum = 5
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

¡El siguiente PySpark debería lograr lo que quieres!

 import pyspark.sql.functions as F dataset = dataset.withColumn('xnum', F.when(F.col('dMinutes').between(0,30), 1) .when(F.col('dMinutes').between(31,60), 2) .when(F.col('dMinutes').between(61,90), 3) .when(F.col('dMinutes').between(91,120), 4) .otherwise(5) )
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!