Hello there! I am trying to get data from FlightData to perform analysis on for a project for college! I am getting as far as getting the info, but I am not sure the best way to get everything into a format or a dataframe that would make this easily analyzable. I am familiar with R, but newer to Wolfram...
arrivalDelaysRaw =
FlightData[
Entity["Airport", "MEM"] ->
Entity["Airport",
"LGA"], {"ArrivalDelay"}, {DateObject[{2023, 1, 1}],
DateObject[{2023, 1, 10}]}];
I call the data with the above, and try to convert with the below, which was working, but isn't working now for some reason.
safeConvertToMinutes[item_] :=
Module[{minutes},
minutes =
Quiet@Check[QuantityMagnitude[QuantityConvert[item, "Minutes"]],
None];
If[minutes === None, Nothing, minutes] (*If conversion fails,
return Nothing to filter out later*)];
processArrivalDelay[item_] :=
If[item === Missing["NotAvailable"], Nothing,(*Exclude missing data*)
safeConvertToMinutes[item] (*Attempt to convert to minutes*)];
processedArrivalDelays = Map[processArrivalDelay, arrivalDelaysRaw];
cleanedArrivalDelays = DeleteCases[processedArrivalDelays, Nothing];
cleanedArrivalDelays // Short
I am trying to perform general descriptive statistics on various flight routes delays, as well as making advanced graphics like stacked line plots or 3D Histograms. Is there anything glaringly obvious I am missing? Thank you in advance!