-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update docs dependencies and Python version #4596
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 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ff4125f
update docs python version
LiamConnors 44ffec4
dependencies update
LiamConnors f4d6c76
update statsmodels version
LiamConnors 07df63d
update shapely version
LiamConnors 7b4a8da
update numpy version
LiamConnors 2e0654d
Update requirements.txt
LiamConnors 589b30b
Update requirements.txt
LiamConnors d844cdd
update dependencies and various code updates
LiamConnors b4aee4b
Update requirements.txt
LiamConnors ee84681
Update requirements.txt
LiamConnors 944a73a
Update requirements.txt
LiamConnors 99e6551
Update requirements.txt
LiamConnors 318552d
Merge branch 'master' into update-docs-build
LiamConnors b5f72fb
Update requirements.txt
LiamConnors a0c4dcb
update datashader version add specific xarray version
LiamConnors cf7cbe6
Merge branch 'master' into update-docs-build
LiamConnors b1888ad
make var name clearer
LiamConnors 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -355,7 +355,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): | |
Levels are given starting from the bottom to the top of the hierarchy, | ||
ie the last level corresponds to the root. | ||
""" | ||
df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) | ||
df_trees = [] | ||
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. again, I don't understand this change but am willing to trust you. |
||
for i, level in enumerate(levels): | ||
df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) | ||
dfg = df.groupby(levels[i:]).sum() | ||
|
@@ -367,11 +367,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): | |
df_tree['parent'] = 'total' | ||
df_tree['value'] = dfg[value_column] | ||
df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] | ||
df_all_trees = df_all_trees.append(df_tree, ignore_index=True) | ||
df_trees.append(df_tree) | ||
total = pd.Series(dict(id='total', parent='', | ||
value=df[value_column].sum(), | ||
color=df[color_columns[0]].sum() / df[color_columns[1]].sum())) | ||
df_all_trees = df_all_trees.append(total, ignore_index=True) | ||
color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) | ||
df_trees.append(total) | ||
df_all_trees = pd.concat(df_trees, ignore_index=True) | ||
return df_all_trees | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -90,7 +90,7 @@ When the argument of `color` corresponds to non-numerical data, discrete colors | |
```python | ||
import plotly.express as px | ||
df = px.data.tips() | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
values='total_bill', color='day') | ||
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) | ||
fig.show() | ||
|
@@ -101,7 +101,7 @@ In the example below the color of Saturday and Sunday sectors is the same as Din | |
```python | ||
import plotly.express as px | ||
df = px.data.tips() | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
values='total_bill', color='time') | ||
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) | ||
fig.show() | ||
|
@@ -114,7 +114,7 @@ For more information about discrete colors, see the [dedicated page](/python/dis | |
```python | ||
import plotly.express as px | ||
df = px.data.tips() | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
fig = px.treemap(df, path=[px.Constant("all"), 'sex', 'day', 'time'], | ||
values='total_bill', color='time', | ||
color_discrete_map={'(?)':'lightgrey', 'Lunch':'gold', 'Dinner':'darkblue'}) | ||
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) | ||
|
@@ -241,7 +241,7 @@ fig = go.Figure(go.Treemap( | |
labels = labels, | ||
values = values, | ||
parents = parents, | ||
marker_colors = ["pink", "royalblue", "lightgray", "purple", | ||
marker_colors = ["pink", "royalblue", "lightgray", "purple", | ||
"cyan", "lightgray", "lightblue", "lightgreen"] | ||
)) | ||
|
||
|
@@ -316,7 +316,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): | |
Levels are given starting from the bottom to the top of the hierarchy, | ||
ie the last level corresponds to the root. | ||
""" | ||
df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) | ||
df_trees = [] | ||
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. as above... |
||
for i, level in enumerate(levels): | ||
df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color']) | ||
dfg = df.groupby(levels[i:]).sum() | ||
|
@@ -328,11 +328,12 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None): | |
df_tree['parent'] = 'total' | ||
df_tree['value'] = dfg[value_column] | ||
df_tree['color'] = dfg[color_columns[0]] / dfg[color_columns[1]] | ||
df_all_trees = df_all_trees.append(df_tree, ignore_index=True) | ||
df_trees.append(df_tree) | ||
total = pd.Series(dict(id='total', parent='', | ||
value=df[value_column].sum(), | ||
color=df[color_columns[0]].sum() / df[color_columns[1]].sum())) | ||
df_all_trees = df_all_trees.append(total, ignore_index=True) | ||
color=df[color_columns[0]].sum() / df[color_columns[1]].sum()), name=0) | ||
df_trees.append(total) | ||
df_all_trees = pd.concat(df_trees, ignore_index=True) | ||
return df_all_trees | ||
|
||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change but I'm willing to take it on faith :-)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LiamConnors My only suggestion here (and at the other spot) is that the
df_trees
variable be renamed to clarify that it's a list of dfs rather than a df.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry, I should have given more context.
The original example uses
df.append
, to append each new dataframe in the loop to the first dataframe, but that method was removed.So here I instead use a list, and add each to a list and use
pd.concat
on the list instead.We had to make this update also in the
plotly.express
library itself at one stage and that's the approach we took: #4190@emilykl good suggestion. Will update the variable name
pd.concat
has existed at least since https://pandas.pydata.org/pandas-docs/version/0.13/generated/pandas.concat.html