0
$\begingroup$

I am trying to use data collected from the FlightData[] command to analyze departure delay data for a school project.

I am getting as far as using a command to get the data, taking it into a named object, and extracting the values from it, but I am trying to remove the missing values, but DeleteMissing[] doesn't seem to work...

I also am trying to get all of my delays to be in units of minutes without hours, but they are pulled in units of minutes and sometimes mixed radix units...

<|Entity["Flight", "202301010000290517"] -> <|"ArrivalDelay" -> Quantity[MixedMagnitude[{0, 5}], MixedUnit[{"Hours", "Minutes"}]]|>, Entity["Flight", "202301010000323732"] -> <|"ArrivalDelay" -> Quantity[-8, "Minutes"]|>, Entity["Flight", "202301020000152941"] -> <|"ArrivalDelay" -> Quantity[-12, "Minutes"]|>, Entity["Flight", "202301020000257894"] -> <|"ArrivalDelay" -> Quantity[-30, "Minutes"]|>,

Also, I want to do statistical analysis with this data I am collecting, and have plans to track various routes for a year, and would like to make some layered line graphs. I had tried before, but I got a mismatch saying the length of the sets was not the same and this could not be done. Is there a way around this?

I think I am also having an issue with the outputs being ArrivalDelay -> 4 min or 1 hr 5 min, and I can't seem to get the raw numbers away from the ArrivalDelay signifier and I'm afraid this is also causing me issues.

I think the biggest hump I am trying to overcome is the data collecting and cleaning. I am newer to wolfram, and have most of my experience in R, but am trying to challenge myself to learn a new skill for school. Wolfram seems incredibly intuitive and powerful once the basics are grasped which I am trying to do here! Any help is appreciated!

I am sure I will have more questions as I work more, but I appreciate any help with this! I have been speaking with my advisor and we are hoping that this project will get more people in the department interested in exploring other tools for data analysis, such as wolfram, because it really seems to be able to make graphics that are a bit more interesting than R!

I have attached a screenshot with a sample output which I hope is helpful.screenshot of a flightdata entity call for arrival delays from MEM to LGA for 1/1/23 to 5/31/23

$\endgroup$

1 Answer 1

1
$\begingroup$

For the following mock entry:

fdata = <|Entity["Flight", "202301010000290517"] -> <|
    "ArrivalDelay" -> 
     Quantity[MixedMagnitude[{1, 5}], 
      MixedUnit[{"Hours", "Minutes"}]]|>
  , Entity["Flight", "202301010000323732"] -> <|
    "ArrivalDelay" -> Quantity[-8, "Minutes"]|>
  , Entity["Flight", "202301020000152941"] -> Missing[NotAvailable]
  , Entity["Flight", "202301020000257894"] -> <|
    "ArrivalDelay" -> Quantity[-30, "Minutes"] |>
   |>

rule = {Quantity[a_, b_] :> UnitConvert[Quantity[a, b], "Minutes"]};
AssociationMap[Replace[#, rule, {2}] &, fdata] // DeleteMissing

enter image description here


I have benefited from 263842.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.