Skip to content

完成作業-鄭典-AIPE03#40

Open
django-cheng wants to merge 1 commit into
Zenobia0000:mainfrom
django-cheng:main
Open

完成作業-鄭典-AIPE03#40
django-cheng wants to merge 1 commit into
Zenobia0000:mainfrom
django-cheng:main

Conversation

@django-cheng

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

📊 作業批改結果

總分:335 / 600(56%)— 等級 F


💡 完整解答請到你自己 fork 的 repo → Actions 頁籤查看。

M1 NumPy(100/100 — 100%)

題目 分數 狀態
test_green_mean 10/10
test_green_double 10/10
test_green_filter 10/10
test_yellow_expensive_count 15/15
test_yellow_top3_stock_indices 15/15
test_yellow_restock_cost 15/15
test_red_double11_prices 20/20
test_red_no_forloop 5/5

M2 Pandas 清理(86/100 — 86%)

題目 分數 狀態
test_green_read_csv 0/10
test_green_shape 10/10
test_green_dtypes 10/10
test_yellow_clean_columns 15/15
test_yellow_clean_amount 15/15
test_yellow_drop_duplicates 15/15
test_red_clean_orders_returns_df 4/4
test_red_clean_orders_columns 0/4
test_red_clean_orders_amount_is_numeric 4/4
test_red_clean_orders_date_is_datetime 5/5
test_red_clean_orders_no_nulls 4/4
test_red_clean_orders_no_duplicates 4/4
❌ 錯誤提示(點擊展開)

test_green_read_csv

tests/test_m2.py:17: in test_green_read_csv
    result = green_read_csv()
             ^^^^^^^^^^^^^^^^
homework/m2_pandas_cleaning.py:23: in green_read_csv
    df_raw = pd.read_csv()
             ^^^^^^^^^^^^^
E   TypeError: read_csv() missing 1 required positional argument: 'filepath_or_buffer'

test_red_clean_orders_columns

tests/test_m2.py:66: in test_red_clean_orders_columns
    assert col == col.strip().lower(), f"欄位 '{col}' 未清理"
E   AssertionError: 欄位 'Order_ID ' 未清理
E   assert 'Order_ID ' == 'order_id'
E     
E     - order_id
E     + Order_ID

M3 Pandas 進階(74/100 — 74%)

題目 分數 狀態
test_green_load_and_merge 0/10
test_green_row_count 10/10
test_green_column_list 10/10
test_yellow_top_category 15/15
test_yellow_gold_vip_stats 15/15
test_yellow_region_avg_amount 15/15
test_red_rfm_top5_shape 9/9
test_red_rfm_top5_columns 0/8
test_red_rfm_top5_sorted_by_m 0/8
❌ 錯誤提示(點擊展開)

test_green_load_and_merge

tests/test_m3.py:21: in test_green_load_and_merge
    result = green_load_and_merge()
             ^^^^^^^^^^^^^^^^^^^^^^
homework/m3_pandas_advanced.py:28: in green_load_and_merge
    orders
E   NameError: name 'orders' is not defined

test_red_rfm_top5_columns

tests/test_m3.py:79: in test_red_rfm_top5_columns
    assert required.issubset(set(result.columns)), \
E   AssertionError: 缺少必要欄位,你的欄位: ['customer_id', 'customer_name', 'r', 'f', 'm']
E   assert False
E    +  where False = <built-in method issubset of set object at 0x7f5551413d80>({'customer_id', 'c...

test_red_rfm_top5_sorted_by_m

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pandas/core/indexes/base.py:3805: in get_loc
    return self._engine.get_loc(casted_key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index.pyx:167: in pandas._libs.index.IndexEngine.get_loc
    ???
index.pyx:196: in pandas._libs.in...

M4 時間序列(30/100 — 30%)

題目 分數 狀態
test_green_avg_by_month 0/10
test_green_top3_dates 0/10
test_green_date_range 0/10
test_yellow_monthly_revenue 0/15
test_yellow_rolling_avg 15/15
test_yellow_category_median 15/15
test_red_monthly_report_columns 0/9
test_red_monthly_report_values 0/8
test_red_monthly_report_growth 0/8
❌ 錯誤提示(點擊展開)

test_green_avg_by_month

tests/test_m4.py:17: in test_green_avg_by_month
    result = green_avg_by_month()
             ^^^^^^^^^^^^^^^^^^^^
homework/m4_timeseries.py:31: in green_avg_by_month
    df.groupby(df['order_date'].dt.month)['amount']
    ^^
E   NameError: name 'df' is not defined

test_green_top3_dates

tests/test_m4.py:29: in test_green_top3_dates
    result = green_top3_dates()
             ^^^^^^^^^^^^^^^^^^
homework/m4_timeseries.py:45: in green_top3_dates
    top3_dates = df['order_date'].dt.date.value_counts().head(3)
                 ^^
E   NameError: name 'df' is not defined

test_green_date_range

tests/test_m4.py:36: in test_green_date_range
    result = green_date_range()
             ^^^^^^^^^^^^^^^^^^
homework/m4_timeseries.py:56: in green_date_range
    earliest = df['order_date'].min()
               ^^
E   NameError: name 'df' is not defined

test_yellow_monthly_revenue

tests/test_m4.py:45: in test_yellow_monthly_revenue
    result = yellow_monthly_revenue()
             ^^^^^^^^^^^^^^^^^^^^^^^^
homework/m4_timeseries.py:73: in yellow_monthly_revenue
    df.set_index('order_date').resample('ME')['amount'].sum()
    ^^
E   NameError: name 'df' is not defined

test_red_monthly_report_columns

tests/test_m4.py:85: in test_red_monthly_report_columns
    assert not missing, f"缺少欄位: {missing}"
E   AssertionError: 缺少欄位: {'revenue_growth', 'active_customers', 'avg_order_value', 'order_count', 'revenue'}
E   assert not {'active_customers', 'avg_order_value', 'order_count', 'revenue', 'revenue_g...

test_red_monthly_report_values

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pandas/core/indexes/base.py:3805: in get_loc
    return self._engine.get_loc(casted_key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index.pyx:167: in pandas._libs.index.IndexEngine.get_loc
    ???
index.pyx:196: in pandas._libs.in...

test_red_monthly_report_growth

/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pandas/core/indexes/base.py:3805: in get_loc
    return self._engine.get_loc(casted_key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index.pyx:167: in pandas._libs.index.IndexEngine.get_loc
    ???
index.pyx:196: in pandas._libs.in...

M5 視覺化(0/100 — 0%)

題目 分數 狀態
test_green_bar_category 0/10
test_green_hist_amount 0/10
test_green_set_labels 0/10
test_yellow_line_region_trend 0/15
test_yellow_box_vip 0/15
test_yellow_scatter_price_amount 0/15
test_red_category_dashboard_is_figure 0/13
test_red_category_dashboard_has_4_subplots 0/12
❌ 錯誤提示(點擊展開)

test_green_bar_category

tests/test_m5.py:22: in test_green_bar_category
    result = green_bar_category()
             ^^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:32: in green_bar_category
    cate_count = df['category'].value_counts().reset_index()
                 ^^
E   NameError: name 'df' is not defined

test_green_hist_amount

tests/test_m5.py:29: in test_green_hist_amount
    result = green_hist_amount()
             ^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:58: in green_hist_amount
    data = df,
           ^^
E   NameError: name 'df' is not defined

test_green_set_labels

tests/test_m5.py:34: in test_green_set_labels
    result = green_set_labels()
             ^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:78: in green_set_labels
    cate_count = df['category'].value_counts().reset_index()
                 ^^
E   NameError: name 'df' is not defined

test_yellow_line_region_trend

tests/test_m5.py:45: in test_yellow_line_region_trend
    result = yellow_line_region_trend()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:114: in yellow_line_region_trend
    ns_df = df[df['region'].isin(['North', 'South'])].copy()
            ^^
E   NameError: name 'df' is ...

test_yellow_box_vip

tests/test_m5.py:53: in test_yellow_box_vip
    result = yellow_box_vip()
             ^^^^^^^^^^^^^^^^
homework/m5_visualization.py:151: in yellow_box_vip
    data = df,
           ^^
E   NameError: name 'df' is not defined

test_yellow_scatter_price_amount

tests/test_m5.py:58: in test_yellow_scatter_price_amount
    result = yellow_scatter_price_amount()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:175: in yellow_scatter_price_amount
    data = df,
           ^^
E   NameError: name 'df' is not defined

test_red_category_dashboard_is_figure

tests/test_m5.py:65: in test_red_category_dashboard_is_figure
    result = red_category_dashboard("Electronics")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:205: in red_category_dashboard
    cat_df = df[df['category'] == category].copy()
             ^^
E   NameE...

test_red_category_dashboard_has_4_subplots

tests/test_m5.py:70: in test_red_category_dashboard_has_4_subplots
    result = red_category_dashboard("Electronics")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homework/m5_visualization.py:205: in red_category_dashboard
    cat_df = df[df['category'] == category].copy()
             ^^
E   ...

M6 Plotly Capstone(45/100 — 45%)

題目 分數 狀態
test_green_plotly_bar 0/10
test_green_plotly_line 0/10
test_green_plotly_pie 0/10
test_yellow_clean_and_merge 15/15
test_yellow_kpi_summary 15/15
test_yellow_plotly_scatter 15/15
test_red_dashboard_is_figure 0/13
test_red_dashboard_has_traces 0/12
❌ 錯誤提示(點擊展開)

test_green_plotly_bar

tests/test_m6.py:21: in test_green_plotly_bar
    result = green_plotly_bar()
             ^^^^^^^^^^^^^^^^^^
homework/m6_plotly_capstone.py:30: in green_plotly_bar
    df_enriched.groupby('category')['amount']
    ^^^^^^^^^^^
E   NameError: name 'df_enriched' is not defined

test_green_plotly_line

tests/test_m6.py:26: in test_green_plotly_line
    result = green_plotly_line()
             ^^^^^^^^^^^^^^^^^^^
homework/m6_plotly_capstone.py:57: in green_plotly_line
    df_enriched.groupby(df_enriched['order_date'].dt.to_period('M'))['amount']
    ^^^^^^^^^^^
E   NameError: name 'df_enriched' is...

test_green_plotly_pie

tests/test_m6.py:31: in test_green_plotly_pie
    result = green_plotly_pie()
             ^^^^^^^^^^^^^^^^^^
homework/m6_plotly_capstone.py:84: in green_plotly_pie
    df_enriched['vip_level'].value_counts()
    ^^^^^^^^^^^
E   NameError: name 'df_enriched' is not defined

test_red_dashboard_is_figure

tests/test_m6.py:68: in test_red_dashboard_is_figure
    result = red_dashboard()
             ^^^^^^^^^^^^^^^
homework/m6_plotly_capstone.py:202: in red_dashboard
    df = yellow_clean_and_merge(
homework/m6_plotly_capstone.py:111: in yellow_clean_and_merge
    df = pd.read_csv(raw_path)
         ^...

test_red_dashboard_has_traces

tests/test_m6.py:72: in test_red_dashboard_has_traces
    result = red_dashboard()
             ^^^^^^^^^^^^^^^
homework/m6_plotly_capstone.py:202: in red_dashboard
    df = yellow_clean_and_merge(
homework/m6_plotly_capstone.py:111: in yellow_clean_and_merge
    df = pd.read_csv(raw_path)
         ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant