at.Py - bite-sized Python tips for atmosci
Subscribe
Sign in
Home
Latest
Top
Discussions
131. 🐼 pandas for all your datetime needs
📆 Don't write your own date string parser; simply use pandas to parse it for you!
Sep 21, 2023
•
at.Py
1
130. Speed up loading chunks of data with zarr
In the previous example, we rendered the satellite imagery from a TIF file.
Sep 20, 2023
•
at.Py
129. 10848x10848 pixels, high-res satellite image taking forever to render?
You may not need the full resolution rendered on a global extent.
Sep 19, 2023
•
at.Py
128. Want to compare YTD precipitation to climatology?
🐼 #pandas has a built-in cumsum method that will calculate the cumulative sum, grouped by year.
Sep 15, 2023
•
at.Py
127. Unsure of when to use threads or processes?
Use threads for IO tasks (reading/writing to disk, downloading data) or subprocesses.
Sep 14, 2023
•
at.Py
126. Want to interpolate an xarray Dataset?
🌟 The `interp` method is user-friendly!
Sep 13, 2023
•
at.Py
2
125. Want to get all the unique station names without any imports?
Eliminate loops, which are extremely inefficient for large lists, and ifs when handling duplicates by using the built-in data type, `set`.
Sep 12, 2023
•
at.Py
August 2023
124. Reiterate user input with repr
The repr function can be invaluable for echoing back user input precisely, particularly when the input contains spaces.
Aug 18, 2023
•
at.Py
123. Want to check if a number is within a range in pandas?
The use case for this could be matching wind speed to some categorical scale (e.g.
Aug 16, 2023
•
at.Py
122. Looking to save geometry types into parquet/database without adding custom extensions?
With geopandas, you can convert the geometry column into WKT (well-known text) format.
Aug 15, 2023
•
at.Py
July 2023
121. Want to avoid re-downloading files unnecessarily?
Before downloading a file, check if it exists already.
Jul 25, 2023
•
at.Py
120. Are nested lists causing complications within your DataFrame?
Working with lists in #pandas operations can be challenging, as functions like loc/query cannot be directly applied to them.
Jul 16, 2023
•
at.Py
This site requires JavaScript to run correctly. Please
turn on JavaScript
or unblock scripts