I'm trying to download and store in a csv file a big object using the Traffic library
from traffic.data import opensky, airports
low_memory=False
airport = airports['LEMD']
flight = opensky.history(start="2021-06-01 00:00",stop="2021-06-16 00:00",arrival_airport=airport.icao)
flight.to_csv(r"C:\Users\peter\Desktop\cosicas.csv")
But short after it begins running, this comes up:
DtypeWarning: Columns (18) have mixed types.Specify dtype option on import or set low_memory=False.
flight = opensky.history(start="2021-05-15 00:00",stop="2021-06-16 00:00",arrival_airport=airport.icao)
And finally this:
MemoryError: Unable to allocate 2.54 GiB for an array with shape (7, 48728454) and data type float64
I have read a lot and this answer seemed to be the best solution but I do not know how to assign the dtype before it downloads (?).