Skip to content

Commit

Permalink
fix: resolve duplicate 'data'
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhuang18 committed Dec 5, 2024
1 parent 18b5cfb commit cb71481
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dashboard/company/scripts/workflow_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_last_six_months():
openrank_url_template = "https://oss.x-lab.info/open_digger/github/{}/openrank.json"

# 数据存储
data = []
apidata = []

# 从URL获取数据并过滤最近六个月的数据
def fetch_and_filter(url, months):
Expand All @@ -165,7 +165,7 @@ def fetch_and_filter(url, months):

# 将数据存储到目标格式
for month in last_six_months:
data.append({
apidata.append({
"community": community,
"repo_name": repo_name,
"month": month,
Expand All @@ -174,7 +174,7 @@ def fetch_and_filter(url, months):
})

# 转换为DataFrame
df = pd.DataFrame(data)
df = pd.DataFrame(apidata)

# 删除 activity 和 openrank 列中有空值的行
df_cleaned = df.dropna(subset=['activity', 'openrank'])
Expand Down

0 comments on commit cb71481

Please sign in to comment.