isort --profile black --recursive . (#2170)

* isort --profile black --recursive .

* Update codespell.yml

* typo: vertices

* typo: Explanation

* typo: Explanation

* Fix typos
This commit is contained in:
Christian Clauss 2020-07-06 05:18:18 +02:00 committed by GitHub
parent 25d9d819a2
commit cd3e8f95a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -11,12 +11,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v1 # Use v1, NOT v2 - uses: actions/checkout@v1 # Use v1, NOT v2
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
- run: pip install black - run: pip install black isort
- run: black --check . - run: black --check .
- name: If needed, commit black changes to a new pull request - name: If needed, commit black changes to a new pull request
if: failure() if: failure()
run: | run: |
black . black .
isort --profile black --recursive .
git config --global user.name github-actions git config --global user.name github-actions
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com' git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY

View File

@ -13,5 +13,5 @@ jobs:
SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt" SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt"
codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP --quiet-level=2 codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP --quiet-level=2
- name: Codespell comment - name: Codespell comment
if: ${{ failure() }} if: ${{ failure() }}
uses: plettich/python_codespell_action@master uses: plettich/python_codespell_action@master

View File

@ -1,4 +1,4 @@
# Video Explaination: https://www.youtube.com/watch?v=6w60Zi1NtL8&feature=emb_logo # Video Explanation: https://www.youtube.com/watch?v=6w60Zi1NtL8&feature=emb_logo
from typing import List from typing import List

View File

@ -1,4 +1,4 @@
# Youtube Explaination: https://www.youtube.com/watch?v=lBRtnuxg-gU # Youtube Explanation: https://www.youtube.com/watch?v=lBRtnuxg-gU
from typing import List from typing import List

View File

@ -12,7 +12,7 @@ test_graph_2 = {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}
def dfs(graph: dict, vert: int, visited: list) -> list: def dfs(graph: dict, vert: int, visited: list) -> list:
""" """
Use depth first search to find all vertexes Use depth first search to find all vertices
being in the same component as initial vertex being in the same component as initial vertex
>>> dfs(test_graph_1, 0, 5 * [False]) >>> dfs(test_graph_1, 0, 5 * [False])
[0, 1, 3, 2] [0, 1, 3, 2]

View File

@ -250,7 +250,7 @@ def ReportGenerator(
df["dummy"] = 1 df["dummy"] = 1
numeric_cols = df.select_dtypes(np.number).columns numeric_cols = df.select_dtypes(np.number).columns
report = ( report = (
df.groupby(["Cluster"])[ # constract report dataframe df.groupby(["Cluster"])[ # construct report dataframe
numeric_cols numeric_cols
] # group by cluster number ] # group by cluster number
.agg( .agg(
@ -289,14 +289,14 @@ def ReportGenerator(
clustersize = report[ clustersize = report[
(report["Features"] == "dummy") & (report["Type"] == "count") (report["Features"] == "dummy") & (report["Type"] == "count")
] # caclulating size of cluster(count of clientID's) ] # calculate the size of cluster(count of clientID's)
clustersize.Type = ( clustersize.Type = (
"ClusterSize" # rename created cluster df to match report column names "ClusterSize" # rename created cluster df to match report column names
) )
clustersize.Features = "# of Customers" clustersize.Features = "# of Customers"
clusterproportion = pd.DataFrame( clusterproportion = pd.DataFrame(
clustersize.iloc[:, 2:].values clustersize.iloc[:, 2:].values
/ clustersize.iloc[:, 2:].values.sum() # caclulating proportion of cluster / clustersize.iloc[:, 2:].values.sum() # calculating the proportion of cluster
) )
clusterproportion[ clusterproportion[
"Type" "Type"