This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Greetings! Sorry to hear you're having problems. Unfortunately, I've been unable to reproduce your issues with a dataframe of my own data. Can you share a complete, minimal example of code + data that reproduces the problem on your system? Also, can you share the full error traceback? Thanks! Ryan > I have a problem using metpy library. So can you help me. > wind_dir = mpcalc.wind_direction(u, v) When I try to use this method I have > this kind of error: > `wind_direction` given arguments with incorrect units: `u` requires > "[speed]" but given "none", `v` requires "[speed]" but given "none" > > A xarray DataArray or numpy array `x` can be assigned a unit as follows: > from metpy.units import units > x = x * units("m/s"). > > u = (interpolated_df_2['wind_u'].values * units('m/s')) > v = (interpolated_df_2['wind_v'].values * units('m/s')) > > When I add units, have such error: > > > AttributeError: 'float' object has no attribute 'arctan2'. > > Help me Please. Ticket Details =================== Ticket ID: VFZ-653243 Department: Support Python Priority: Low Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.