Skip to content

add_station_lat_lon yields columns with object dtype #2872

@dopplershift

Description

@dopplershift
df = pd.DataFrame({'station': ['KOUN', 'KVPZ', 'KDEN', 'PAAA']})
df = add_station_lat_lon(df, 'station')
df.info()

gives

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 4 entries, 0 to 3
Data columns (total 3 columns):
 #   Column     Non-Null Count  Dtype 
---  ------     --------------  ----- 
 0   station    4 non-null      object
 1   latitude   3 non-null      object
 2   longitude  3 non-null      object
dtypes: object(3)
memory usage: 224.0+ bytes

Apparently it's good enough to pass e.g. assert_almost_equal(df.loc[df.station == 'KOUN'].latitude.values[0], 35.25), but it's painful to pass to e.g. tricontour().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: IOPertains to reading dataType: BugSomething is not working like it should

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions