New Ribbon
Canva+AI創意設計與品牌應用250招:從商業技巧、社群祕技到AI圖文影音特效 快快樂樂學威力導演2024.影音剪輯與AI精彩創作 文淵閣工作室祝福大家新年快樂.龍年吉祥 Power Automate自動化超效率工作術 Midjourney AI圖像魔導書:搭配ChatGPT魔法加倍 超人氣FB+IG+LINE社群經營與行銷力(第二版) 翻倍效率工作術:不會就太可惜的 Excel × ChatGPT 自動化應用 AppInventor2零基礎入門班中文版(第六版) Python零基礎入門班(第四版) C語言學習聖經 用Canva設計超快超質感:平面、網頁、電子書、簡報、影片製作與AI繪圖最速技 PHP8/MySQL網頁程式設計自學聖經 翻倍效率工作術 - 不會就太可惜的Power BI大數據視覺圖表設計與分析(第三版) 社群經營一定要會的影音剪輯與動畫製作術 Notion高效管理250招:筆記×資料庫×團隊協作,數位生活與工作最佳幫手 Office 2021高效實用範例必修16課(附500分鐘影音教學/範例檔) Excel自學聖經(第二版):從完整入門到職場活用的技巧與實例大全 網路開店×拍賣王:蝦皮來了(第二版) 專家都在用的Google最強實戰:表單、文件、試算、簡報、遠距與線上會議 超人氣 Instagram 視覺行銷力(第二版):小編不敗,經營 IG 品牌人氣王的 120 個秘技!

 

  大數據第二版

鍾


更新時間:2021/12/1 上午 11:14:48

 

import pandas as pd
import matplotlib.pyplot as plt

#繪圖中文字型
plt.rcParams["font.sans-serif"] = "mingliu"
plt.rcParams["axes.unicode_minus"] = False

df = pd.read_excel('1111data.xlsx')
city = ['台北', '新北', '桃園', '台中', '台南', '高雄']  #六都
citycount = []  #存六都工作職缺數量的串列
for i in range(len(city)):
    df1 = df[df['工作地點'].str.contains(city[i])]  #取出包含指定地點的資料
    citycount.append(len(df1))

ser = pd.Series(citycount, index=city)  #串列轉Series
print(ser)
plt.axis('off')
ser.plot(kind='pie', title='六都電腦職缺數量', figsize=(6, 6))  #繪製圓餅圖

鍾


更新時間:2021/12/1 上午 11:16:57

 

備註:
(問題顯示)
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-9-c13f8555c0b9> in <module>
      6 plt.rcParams["axes.unicode_minus"] = False
      7
----> 8 df = pd.read_excel('1111data.xlsx')
      9 city = ['台北', '新北', '桃園', '台中', '台南', '高雄']  #六都
     10 citycount = []  #存六都工作職缺數量的串列

C:\ProgramData\Anaconda3\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs)
    297                 )
    298                 warnings.warn(msg, FutureWarning, stacklevel=stacklevel)
--> 299             return func(*args, **kwargs)
    300
    301         return wrapper

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in read_excel(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, parse_dates, date_parser, thousands, comment, skipfooter, convert_float, mangle_dupe_cols, storage_options)
    334     if not isinstance(io, ExcelFile):
    335         should_close = True
--> 336         io = ExcelFile(io, storage_options=storage_options, engine=engine)
    337     elif engine and engine != io.engine:
    338         raise ValueError(

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in __init__(self, path_or_buffer, engine, storage_options)
   1069                 ext = "xls"
   1070             else:
-> 1071                 ext = inspect_excel_format(
   1072                     content=path_or_buffer, storage_options=storage_options
   1073                 )

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in inspect_excel_format(path, content, storage_options)
    947     assert content_or_path is not None
    948
--> 949     with get_handle(
    950         content_or_path, "rb", storage_options=storage_options, is_text=False
    951     ) as handle:

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
    649         else:
    650             # Binary mode
--> 651             handle = open(handle, ioargs.mode)
    652         handles.append(handle)
    653

FileNotFoundError: [Errno 2] No such file or directory: '1111data.xlsx'

文淵閣工作室

文淵閣工作室
更新時間:2021/12/1 下午 08:25:36

 

錯誤訊息為找不到 1111data.xlsx,請檢查程式相同資料夾中是否有 1111data.xlsx。




 

 

Re:大數據第二版

請輸入姓名。

已超出字元數目的最大值。


請輸入電子郵件。

格式無效。


請輸入內容。