顯示具有 PYTHON 標籤的文章。 顯示所有文章
顯示具有 PYTHON 標籤的文章。 顯示所有文章

20230425

Auto-GPT

Auto-GPT

..................................................
#Update = 2023-04-21
..................................................
#Keywords = Auto-GPT, Python, Git, .
..................................................

Steps:

1. Install Python (above version 3.8)

Download Python - Website = https://www.python.org/downloads/

2. Install Git , then open prompt (Git Bash), input: 
    
    git clone https://github.com/Torantulino/Auto-GPT.git

3. In the Auto-GPT folder, Open ".env.template" file, and input the OpenAI key into "OPENAI_API_KEY" (replace the " your-openai-api-key")
    Save as ".env" file

4. Open (Anaconda) Prompt, go to the Auto-GPT folder, Input : 
    
    pip3 install -r requirements.txt

5. Download "Docker Desktop", Install and execute the Docker (just keep the program open).


6. Open (Anaconda) Prompt, go to the Auto-GPT folder, Input :  
 
    python -m autogpt

7. Execute Auto-GPT :

(1) Input AI Name.
(2) Define AI Role.
(3) Input Goals for your AI.

Welcome to Auto-GPT!  run with '--help' for more information.

Create an AI-Assistant:  Enter the name of your AI and its role below. Entering nothing will load defaults.Name your AI:  For example, 'Entrepreneur-GPT'

AI Name: ***

Describe your AI's role:  For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.'

*** here!  I am at your service.
Describe your AI's role:  For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.'
*** is: ***

Enter up to 5 goals for your AI:  For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously'
Enter nothing to load defaults, enter nothing when finished.
Goal 1: ***
Goal 2: ***
Goal 3: ***
Goal 4: ***
Goal 5: ***
Using memory of type:  LocalCache
Using Browser:  chrome
can read more here: https://github.com/Significant-Gravitas/Auto-GPT#openai-api-keys-configuration
- Thinking...
..................................................

#REFERENCE

[] Auto-GPT是什麼?怎麼用?免人工介入自動完成下一步,30 分鐘內建立你的 AI 助手, TECHBANG, 20230414, https://www.techbang.com/posts/105416-chatgpt-ai-autogpt

[] GPT神器又一個:AutoGPT!不必人工下指令,怎麼下載?安裝步驟一次看, BNEXT, 20230414, https://www.bnext.com.tw/article/74834/gpt-autogpt-36kr


..................................................

20230118

Google Colab

Google Colab

..................................................
#Update : 2023-01-18
..................................................
#Keywords : Python, Google Colab, Jupyter, ... .
..................................................

#導入 Google Drive 内的檔案


Step-1. Mount Google Drive :

from google.colab import drive
drive.mount('/content/drive/')

Step-2. Assign and read the data link ()

/content/drive/ ... / OOO.xlsx

..................................................

#REFERENCE

[] 新手 3/3:如何用 Google Colab 讀取/輸出檔案?從 Google Drive 存取 CSV, 20210405, https://pythonviz.com/colab-jupyter/google-colab-notebook-file-io-csv-input-output/


..................................................

20230114

Anaconda

Anaconda

..................................................
#Update : 2023-01-14
..................................................
#Keywords : Python, Anaconda, ... .
..................................................

#Update Navigator (Manual):

[1] Open Anaconda Prompt.
[2] Input and execute :
        conda deactivate
        conda update anaconda-navigator

..................................................

#REFERENCE

[] Anaconda, Website, https://www.anaconda.com/

..................................................

20220128

Python - Pandas

Python - Pandas

..................................................
# Date : 2022-01-28
..................................................
# Keywords: Code, Python, Web crawler, Pandas, ... .
..................................................

# 利用 Pandas 讀取網頁表格資料。

..................................................

# REFERENCE

[] [Pandas教學]掌握Pandas DataFrame讀取網頁表格的實作技巧, Learncodewithmike, 20201108, https://www..com/2020/11/read-html-table-using-pandas.html

[財經爬蟲] 如何透過Python 網路爬蟲抓取Goodinfo 台灣股市資訊網?, Youtube, https://youtu.be/BsZTtGKZweA

..................................................

20210728

PYTHON - Draw Map

PYTHON - Draw Map

..................................................

# Update = 2021-07-28

..................................................

# Keywords = PYTHON, Map, Jupyter, ... .

..................................................


..................................................


# REFERENCE

[] python 資料視覺化 - 使用Folium製作地震資料地圖, YOUTUBE, https://youtu.be/cJiWsZugoP0

[] Python 如何畫出漂亮的地圖?, ZHIHU, https://www.zhihu.com/question/33783546

[] Python繪制地圖神器folium入門, ZHIHU, https://zhuanlan.zhihu.com/p/112324234

[] Python 讀取與寫入 CSV 檔案教學與範例, GTWANG, 20180322, https://blog.gtwang.org/programming/python-csv-file-reading-and-writing-tutorial/

[] python最全畫地圖,視覺化資料, ITREAD01, 20190104, https://www.itread01.com/content/1546545616.html

[] 地理資料視覺化使用 Folium, HANKLU, 20190619, https://blog.hanklu.tw/post/2019/folium/

[] 地圖視覺化神器folium 上手後直接開大, TW511, 20210310, https://tw511.com/a/01/27462.html

[] Python繪製地圖神器folium的新人入門指南, IT415, 20210523, https://www.it145.com/9/140669.html

..................................................



20210518

Python - Learning Source

Python - Learning Source

..................................................
# Date : 2021-05-18
..................................................
# Keywords: Code, Python, Learning, Source, ... .
..................................................

[] 彭彭的課程教學 = https://training.pada-x.com/online.htm

[] Python-100天從新手到大師 = https://github.com/jackfrued/Python-100-Days

[] 莫煩 = https://mofanpy.com/
..................................................

# REFERENCE

..................................................

Python -數值運算 (Math Calculation)

Python -數值運算 (Math Calculation)

..................................................
# Date : 2021-05-18
..................................................
# Keywords: Code, Python, Math, Calculation, ... .
..................................................

# log2()

import math
x = 100
print('%.3f' % math.log2(x))

# 使用 '%f' %,以浮點數輸出;使用 '%。3f' % ,定義以小數點3位輸出。

..................................................

# REFERENCE


..................................................

20210514

PYTHON - 檔案處理

PYTHON - 檔案處理
..................................................
# Date : 2021-05-14
..................................................
# Keywords: NEWS, Review, 2021-05, ... .
..................................................


..................................................

# REFERENCE

[] Python 初學第十二講—檔案處理, CCCLUB, 20190624, https://medium.com/ccclub/ccclub-python-for-beginners-tutorial-bf0648108581

..................................................

20210510

Python - 網路爬蟲 (Web Crawler)

Python - 網路爬蟲 (Web Crawler)

..................................................
# Date : 2021-05-10
..................................................
# Keywords: Code, Python, Web crawler, ... .
..................................................

# 網頁爬蟲與資料分析流程 [CASTMAN]
  • [1] 尋找資料來源
  • [2] 使用 python 套件進行爬蟲
  • [3] 截取並過濾資料
  • [4] 分析資料
  • [5] 展示資料
..................................................

# 使用工具:Python、Jupyter。

# 使用套件:

[] requests
[] BeautifulSoup [WIKI]
[] Pandas [WEB]

# Installation : 
[] 安裝 requests:於 CMD 輸入 pip3 install requests
[] 安裝 BeautifulSoup: 於CMD 輸入 pip install beautifulsoup4

..................................................

# 根據不同網頁內容使用不同套件來解析:

[] HTML, 使用 BeautifulSoup。
[] JSON, 使用內建之 JSON 套件即可 (import json)。
[] REQUEST:依網頁内容分 get and post.

..................................................

# 網路爬蟲範例:

[] 用 beautifulsoup 解析 HTML,抓標題:https://youtu.be/9Z9xKWfNo7k

..................................................

實際步驟:

一、載入套件
二、截取網頁資訊:使用 get

抓取圖片:
..................................................

JUPYTER Notebook

# 快捷鍵:
[] Ctrl + Enter = 在目前 CELL 中執行。
[] Alt + Enter = 執行 then 插入一新的 CELL。
..................................................

# REFERENCE

[] Python新手教學(Part 1):用爬蟲爬全球股價!, FINLAB, https://www.finlab.tw/用爬蟲爬全世界股價/

[] [Python-Finance]證交所股票價格爬蟲實作教學(Let’s crawl stock price)-附程式碼, YCY-TAI, https://ycy-tai.medium.com/python-finance-證交所股票價格爬蟲實作教學-lets-crawl-stock-price-附程式碼-e5d07d41b779

[] 給初學者的 Python 網頁爬蟲與資料分析 (1) 前言, CASTMAN, 20161219, http://blog.castman.net/教學/2016/12/19/python-data-science-tutorial-1.html

[] 使用 Python 資料分析和視覺化上市櫃公司薪資公開資料, Techbridge, 20190726, https://blog.techbridge.cc/2019/07/26/how-to-use-taiwan-salary-data-to-do-python-data-analytics-and-data-visualization/

[] [Python] Pandas 基礎教學, ORANWIND, 20171001, https://oranwind.org/python-pandas-ji-chu-jiao-xue/

# REF. Package
..................................................

20200816

Python Libraries

Python Libraries

..................................................

# Update : 2021-02-21

..................................................

# Keywords: Code, Python, LIbraries, Extension, ... .

..................................................

# Data Science Libraries : 

[] Pandas, NumPy, Scikit-learn, Gradio, TensorFlow, Keras, SciPy, Statsmodels, Plotly, Seaborn [Towardsdatascience, 20210218].

..................................................

# Brief Introduction :

[] Matplotlib = Plotting.

[] NumPy = Matrix calculation.

[] Pandas = Data analysis.

..................................................

# requests = Http application.

[] 電腦中若安裝多種版本的 Python,可利用『where pip』指令,查詢安裝位置。

..................................................

# REFERENCE

[] Top 10 Python Libraries for Data Science in 2021, Towardsdatascience, 20210218, https://towardsdatascience.com/top-10-python-libraries-for-data-science-in-2021-b122f168ae62

..................................................

20190918

Visual Studio Code

Visual Studio Code

..................................................
# Date : 2019-09-18
# Author : Enson, Yu, Ph.D.
..................................................
# Keywords: Code, Visual Studio Code, Python, ... .
..................................................

# Visual Studio Code,

  *Official Website = https://code.visualstudio.com/

  *Python Extension = https://marketplace.visualstudio.com/items?itemName=ms-python.python

..................................................

# 快捷鍵:

Ctrl + / :多行直接變註解。

..................................................

# 影音教學

  *彭彭的課程 = https://www.youtube.com/user/padalab

..................................................

20190917

PYTHON - 檔案處理

PYTHON - 檔案處理

..................................................
# Date : 2019-09-17
# Author : Enson, Yu, Ph.D.
..................................................
# Keywords: Code, Python, File, ... .
..................................................

# 檔案開啟、儲存、關閉:

REF.File Open, Save, and Close:

[] Python 文字檔案的讀取和儲存 By 彭彭, https://youtu.be/C4OkV6DrVRs

..................................................

PYTHON 基礎入門

PYTHON 基礎入門

..................................................
# Date : 2019-09-17
# Author : Enson, Yu, Ph.D.
..................................................
# Keywords: Code, Python, ... .
..................................................

# 基礎學習

  * 『#』 為註解符號。

  * PIP 套件管理工具
  * 執行:python 檔案名稱
..................................................

# Jupyter
  • [] 安裝:pip3 install jupyter
  • [] 執行:jupyter notebook
..................................................

# 套件 (Package):
  • [] 模組套件說明:[dokelung-blog]
  • [] requests : 用以模擬網路請求行為。

..................................................

# REFERENCE

## REF. Fundamental Study.

## REF. JUPYTER
..................................................

20190203

Python 入門資料

Python 入門資料

............................................................
Keywords: Python, Introduction, Fundamental, Jupyter, ... .
............................................................

數字 a = 123
字串 a = '123'
............................................................

INPUT :讓使用者輸入資料,形態為字串。
..........

In[]:
a = input() # a from input data.
print ('a =', a)

Out[]:
123
a = 123
..........

In[]:
a = input('From your input data:') # a from input data.
print ('a =', a)

Out[]:
From your input data:156 a = 156

..........

# 四則運算
a = int(input()) # a from input data.
print('a is = ', a)
b = int(input()) # b from input data.
print('b is = ', b)
print ('a + b = ',a+b)
print ('a - b = ',a-b)
print ('a * b = ',a*b)
print ('a/b = ',a/b)

..........

# for loop
for i in range (0,10): # range is from 0 to n-1. print(i)

Out[] = 0123456789
............................................................

REFERENCE:

............................................................

PYTHON 環境設定

PYTHON 環境設定
............................................................
Keywords: Python, Environment, ... .
............................................................

設定 WIDOWS 環境變數 [https://ericjhang.github.io/archives/ad5450f3.html]:

1. 找出 Python 安裝路徑(資料夾路徑)
2. 開啟 Windows 進階系統設定》環境變數》PATH,輸入:
(1)Python 安裝路徑 (2)Scripts 之路徑(位於 Python 安裝目錄下)

............................................................




20180206

Python - requests

Python - requests
Keywords:Python, package, requests, ... .
____________________________________________________________

# 截取網頁 URL 內容。

import request
www = requests.get ("URL")
print (www.text)

____________________________________________________________

20180202

Python - Test Codes

Python - Test Codes

Keywords: Python, Test, Code, ... .
____________________________________________________________

#Import math package, then calculate sin 90 degree.
>>> import math
>>> print(math.sin(math.pi/2))
1.0
____________________________________________________________

#定義 x 與 y,再顯示 x與y值。

>>>x,y = 2,3
>>>print (x,y)
2,3
____________________________________________________________

#輸入年齡以判斷差幾歲可以投票

>>>print ('Please input your age.')
>>>age = int (input('age='))
>>>if age >=20:
>>> print ("please goto vote")
>>>else:
diff = 20 - age
>>>print ('You need {} years to vote.'.format(diff))

____________________________________________________________

20180130

Python - Zen of Python

Python - Zen of Python

Keywords: Python, Coding, ... .
____________________________________________________________

開啟 PYTHON 編輯器後,輸入:import this
即可顯示 "The Zen of Python" .

____________________________________________________________

20180125

TensorFlow

TensorFlow

Keywords : Python, Google, TensorFlow, Machine Learning ... .
____________________________________________________________

Python 安裝 TensorFlow [TensorFlow]

  • C:\> pip3 install --upgrade tensorflow
  • C:\> pip3 install --upgrade tensorflow-gpu

____________________________________________________________

REFERENCE



____________________________________________________________