Skip to content

Commit 9301ff6

Browse files
committed
Drop categories
1 parent a7a42d0 commit 9301ff6

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

dataretrieval/waterdata/api.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ def get_daily(
165165
if your internet connection is spotty. The default (NA) will set the
166166
limit to the maximum allowable limit for the service.
167167
convert_type : boolean, optional
168-
If True, converts columns to appropriate types like numeric, datetime,
169-
boolean, categorical, etc.
168+
If True, converts columns to appropriate types.
170169
171170
Returns
172171
-------
@@ -476,8 +475,7 @@ def get_monitoring_locations(
476475
Note that the USGS Water Data APIs use camelCase "skipGeometry" in
477476
CQL2 queries.
478477
convert_type : boolean, optional
479-
If True, converts columns to appropriate types like numeric, datetime,
480-
boolean, categorical, etc.
478+
If True, converts columns to appropriate types.
481479
482480
Returns
483481
-------
@@ -669,8 +667,7 @@ def get_time_series_metadata(
669667
if your internet connection is spotty. The default (None) will set the
670668
limit to the maximum allowable limit for the service.
671669
convert_type : boolean, optional
672-
If True, converts columns to appropriate types like numeric, datetime,
673-
boolean, categorical, etc.
670+
If True, converts columns to appropriate types.
674671
675672
Returns
676673
-------
@@ -845,8 +842,7 @@ def get_latest_continuous(
845842
if your internet connection is spotty. The default (None) will set the
846843
limit to the maximum allowable limit for the service.
847844
convert_type : boolean, optional
848-
If True, converts columns to appropriate types like numeric, datetime,
849-
boolean, categorical, etc.
845+
If True, converts columns to appropriate types.
850846
851847
Returns
852848
-------
@@ -1020,8 +1016,7 @@ def get_latest_daily(
10201016
if your internet connection is spotty. The default (None) will set the
10211017
limit to the maximum allowable limit for the service.
10221018
convert_type : boolean, optional
1023-
If True, converts columns to appropriate types like numeric, datetime,
1024-
boolean, categorical, etc.
1019+
If True, converts columns to appropriate types.
10251020
10261021
Returns
10271022
-------
@@ -1186,8 +1181,7 @@ def get_field_measurements(
11861181
if your internet connection is spotty. The default (None) will set the
11871182
limit to the maximum allowable limit for the service.
11881183
convert_type : boolean, optional
1189-
If True, converts columns to appropriate types like numeric, datetime,
1190-
boolean, categorical, etc.
1184+
If True, converts columns to appropriate types.
11911185
11921186
Returns
11931187
-------

dataretrieval/waterdata/utils.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -703,22 +703,13 @@ def _type_cols(df: pd.DataFrame) -> pd.DataFrame:
703703
"last_modified",
704704
"time",
705705
]
706-
categorical_cols = [
707-
"approval_status",
708-
"monitoring_location_id",
709-
"parameter_code",
710-
"unit_of_measure",
711-
]
712706

713707
for col in cols.intersection(time_cols):
714708
df[col] = pd.to_datetime(df[col], errors="coerce")
715709

716710
for col in cols.intersection(numerical_cols):
717711
df[col] = pd.to_numeric(df[col], errors="coerce")
718712

719-
for col in cols.intersection(categorical_cols):
720-
df[col] = df[col].astype("category")
721-
722713
return df
723714

724715

0 commit comments

Comments
 (0)