day 3 | consecutive days | pyspark scenario based interview questions and answers

Sdílet
Vložit
  • čas přidán 13. 09. 2024
  • day 3
    consecutive days
    pyspark scenario based interview questions and answers
    Create DataFrame Code :
    ====================
    data = [
    (1, '2024-03-01'),
    (1, '2024-03-02'),
    (1, '2024-03-03'),
    (1, '2024-03-04'),
    (1, '2024-03-06'),
    (1, '2024-03-10'),
    (1, '2024-03-11'),
    (1, '2024-03-12'),
    (1, '2024-03-13'),
    (1, '2024-03-14'),
    (1, '2024-03-20'),
    (1, '2024-03-25'),
    (1, '2024-03-26'),
    (1, '2024-03-27'),
    (1, '2024-03-28'),
    (1, '2024-03-29'),
    (1, '2024-03-30'),
    (2, '2024-03-01'),
    (2, '2024-03-02'),
    (2, '2024-03-03'),
    (2, '2024-03-04'),
    (3, '2024-03-01'),
    (3, '2024-03-02'),
    (3, '2024-03-03'),
    (3, '2024-03-04'),
    (3, '2024-03-04'),
    (3, '2024-03-04'),
    (3, '2024-03-05'),
    (4, '2024-03-01'),
    (4, '2024-03-02'),
    (4, '2024-03-03'),
    (4, '2024-03-04'),
    (4, '2024-03-04')
    ]
    schema = "user_id int , login_date string"
    df = spark.createDataFrame(data = data , schema = schema)
    df.display()
    Let's connect on LinkedIn : / dhirajgupta141
    pyspark 30 days challenge : • pyspark 30 days challenge
    DSA In Python Interview Series : • dsa for data engineer ...
    PySpark Interview Series : • pyspark interview ques...
    Pandas Interview Series : • pandas interview quest...
    SQL Interview Series : • sql interview question...
    PySpark Installation and Setup : • Spark Installation | P...
    #interview #spark #pyspark

Komentáře • 6