發表文章

目前顯示的是 8月, 2018的文章

Python | 解決 Pandas 套件無法解析文件的編碼

最近在透過 pandas 學習如何匯入 csv 資料到 python 中,但是總是出現 UnicodeDecodeError 的警告視窗,網路上也有解法,我也進行了嘗試。 # 原本是這樣的結構 pd.read_csv(file_csv, parse_dates=True) # 之後後面加入 encode="utf-8" pd.read_csv(file_csv, parse_dates=True, encoding="utf-8") 但是你還是會發現,有時候依然會出現 UnicodeDecodeError 的警告,這個原因在於, Source 的 Encoder 並不是 utf-8,所以你必須把來源資料轉換成 utf-8 ,才不會出現 Encode 錯誤。

Android | SplashScreen 建置

本次目的是為建置在執行主程式前的 Splash Screen ,此效果在許多 App 上都有實踐,其目的有幾種:顯示團隊 LOGO、作為載入資源的前置作業並顯示進度。 此次需要建立三個檔案。 分別是: SplashScreen.java ( 和 MainActivity 同資料夾 ) activity_splash.xml ( 和 activity_main.xml 同資料夾 ) 圖檔 ( 置於 mipmap 註1 ) 需要修改以下檔案內容。 分別是: MainActivity.java ( 避免畫面返回 Splash Screen ) AndroidManifest.xml ( 修改初始啟動畫面 ) 1.建立 activity_splash.xml @mipmap/load 為圖檔 <relativelayout   android:layout_height="match_parent"   android:layout_width="match_parent"   xmlns:android="http://schemas.android.com/apk/res/android"> <imageview     android:id="@+id/imgLogo"     android:layout_centerinparent="true"     android:layout_height="wrap_content"     android:layout_width="wrap_content"     android:scaletype="fitCenter"     android:src="@mipmap/load" /> <textview     android:gravity="center_horizontal"     android:layout_alignparentbottom="true"     and...