-
Notifications
You must be signed in to change notification settings - Fork 16
Update all indicators for pandas v2 #1825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ea6e3d7
don't use loc to avoid a future warning about calling int on a single…
nmdefries e37c736
set numeric_only in geomap sum to avoid concatting strings
nmdefries fab4c62
replace iteritems
nmdefries 53f0d0c
replace append
nmdefries f6d564d
make dates comparable
nmdefries 5f97212
changehc
nmdefries 3845a1e
claims_hosp
nmdefries 4d7c722
doctor_visits
nmdefries c077c13
cpr
nmdefries 9ca8530
nchs_mortality
nmdefries fcbbafc
quidel_covidtest
nmdefries 6a82efc
linting
nmdefries 79ab7c8
Merge branch 'main' into ndefries/pandasv2-fix-tests
nmdefries 4f28fba
unpin pandas 2.0.0
nmdefries 513a39b
concat outside of loops
nmdefries File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,8 +240,8 @@ def test_nation_from_state(self): | |
'sample_size': [None, None], | ||
'publish_date': [datetime(year=2020, month=1, day=1)]*2,}) | ||
|
||
pa_pop = int(state_pop.loc[state_pop.state_id == "pa", "pop"]) | ||
wv_pop = int(state_pop.loc[state_pop.state_id == "wv", "pop"]) | ||
pa_pop = int(state_pop.loc[state_pop.state_id == "pa", "pop"].iloc[0]) | ||
wv_pop = int(state_pop.loc[state_pop.state_id == "wv", "pop"].iloc[0]) | ||
Comment on lines
+243
to
+244
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wacky. good catch! |
||
tot_pop = pa_pop + wv_pop | ||
|
||
assert True, nation_from_state( | ||
|
@@ -285,7 +285,14 @@ def test_generate_prop_signal_msa(self): | |
geomapper = GeoMapper() | ||
county_pop = geomapper.get_crosswalk("fips", "pop") | ||
county_msa = geomapper.get_crosswalk("fips", "msa") | ||
msa_pop = county_pop.merge(county_msa, on="fips", how="inner").groupby("msa").sum().reset_index() | ||
msa_pop = county_pop.merge( | ||
county_msa, on="fips", how="inner" | ||
).groupby( | ||
"msa" | ||
).sum( | ||
numeric_only=True | ||
).reset_index( | ||
) | ||
|
||
test_df = pd.DataFrame({ | ||
'geo_id': ['35620', '31080'], | ||
|
@@ -294,8 +301,8 @@ def test_generate_prop_signal_msa(self): | |
'se': [None, None], | ||
'sample_size': [None, None],}) | ||
|
||
nyc_pop = int(msa_pop.loc[msa_pop.msa == "35620", "pop"]) | ||
la_pop = int(msa_pop.loc[msa_pop.msa == "31080", "pop"]) | ||
nyc_pop = int(msa_pop.loc[msa_pop.msa == "35620", "pop"].iloc[0]) | ||
la_pop = int(msa_pop.loc[msa_pop.msa == "31080", "pop"].iloc[0]) | ||
|
||
expected_df = pd.DataFrame({ | ||
'geo_id': ['35620', '31080'], | ||
|
@@ -342,8 +349,8 @@ def test_generate_prop_signal_non_msa(self): | |
'se': [None, None], | ||
'sample_size': [None, None],}) | ||
|
||
pop1 = int(geo_pop.loc[geo_pop[settings["code_name"]] == settings["geo_names"][0], "pop"]) | ||
pop2 = int(geo_pop.loc[geo_pop[settings["code_name"]] == settings["geo_names"][1], "pop"]) | ||
pop1 = int(geo_pop.loc[geo_pop[settings["code_name"]] == settings["geo_names"][0], "pop"].iloc[0]) | ||
pop2 = int(geo_pop.loc[geo_pop[settings["code_name"]] == settings["geo_names"][1], "pop"].iloc[0]) | ||
|
||
expected_df = pd.DataFrame({ | ||
'geo_id': settings["geo_names"], | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.