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

2019年5月16日 星期四

[Python] 如何用 pandas-datareader 抓取台股資料

Environment : Windows + Jupyter
#需要的套件
import pandas as pd
import pandas_datareader as pdr
import datetime as datetime
import matplotlib.pyplot as plt

#國泰金控(2882)為範例
stock_number = '2882.TW'
start = datetime.datetime(2018,1,1)
end   = datetime.datetime(2018,6,1)
DataFrame = pdr.DataReader(stock_number, 'yahoo', start, end)

print DataFrame

#畫圖
fig = plt.figure(figsize=(5, 5))
AX  = fig.add_axes([0.1,0.5,1,0.2])
AX2 = fig.add_axes([0.1,0.1,1,0.2])

#表格標題
AX.set_title(stock_number)
AX2.set_title(stock_number)

#收盤價
AX.plot(DataFrame['Close'], label='Close', color='B')
#成交量
AX2.bar(DataFrame.index, DataFrame['Volume'], label='Volume', color='R')

AX.legend();
AX2.legend();

                 High        Low       Open      Close    Volume  Adj Close
Date                                                                       
2018-01-02  54.400002  53.299999  53.400002  54.200001  15815336  51.762951
2018-01-03  55.400002  54.299999  54.799999  55.200001  31833721  52.717987
2018-01-04  55.400002  54.500000  55.299999  55.400002  17321761  52.908997
2018-01-05  55.799999  55.000000  55.299999  55.700001  22221913  53.195503
2018-01-08  55.799999  55.000000  55.799999  55.700001  22253987  53.195503
2018-01-09  55.799999  55.200001  55.700001  55.799999  12742940  53.291008
2018-01-10  56.700001  55.599998  56.500000  55.599998  32365670  53.099998
2018-01-11  55.900002  55.000000  55.799999  55.400002  16238278  52.908997
2018-01-12  55.900002  55.299999  55.500000  55.599998  11693485  53.099998
2018-01-15  56.599998  55.900002  56.000000  56.500000  24899376  53.959534
2018-01-16  56.799999  56.200001  56.500000  56.599998  16594879  54.055035
2018-01-17  56.400002  55.799999  56.299999  56.299999  17042147  53.768524
2018-01-18  56.500000  55.799999  56.500000  55.900002  14582079  53.386513
2018-01-19  56.200001  55.599998  55.700001  56.000000  10183237  53.482014
2018-01-22  56.099998  55.200001  55.799999  55.599998  18754752  53.099998
2018-01-23  56.500000  55.299999  55.799999  56.000000  15109737  53.482014
2018-01-24  55.900002  55.000000  55.799999  55.700001  18367391  53.195503
2018-01-25  56.099998  55.200001  55.700001  55.599998  17297427  53.099998
2018-01-26  55.299999  54.500000  55.299999  54.700001  22318756  52.240471
2018-01-29  55.200001  54.599998  55.000000  55.200001  15710037  52.717987
2018-01-30  55.099998  54.400002  55.000000  54.400002  13049295  51.953960
2018-01-31  55.000000  53.799999  54.000000  54.599998  16946736  52.144962
2018-02-01  55.200001  54.599998  54.700001  54.799999  10666353  52.335972
2018-02-02  55.000000  54.400002  54.500000  54.700001   9381541  52.240471
2018-02-05  54.099998  53.500000  53.500000  54.099998  14671051  51.667446
2018-02-06  52.500000  50.500000  52.099998  50.799999  38452497  48.515827
2018-02-07  53.500000  52.000000  52.400002  52.700001  27209771  50.330399
2018-02-08  53.500000  52.799999  53.299999  53.299999  14356310  50.903416
2018-02-09  53.299999  52.000000  52.099998  52.799999  22072666  50.425900
2018-02-12  53.799999  53.000000  53.799999  53.000000  17578655  50.616909
...               ...        ...        ...        ...       ...        ...
2018-04-20  52.799999  52.200001  52.799999  52.500000  10233680  50.139389
2018-04-23  52.799999  52.200001  52.200001  52.500000  10406015  50.139389
2018-04-24  52.900002  52.400002  52.799999  52.500000  10370094  50.139389
2018-04-25  52.500000  51.700001  52.299999  52.200001  23868687  49.852879
2018-04-26  52.799999  52.000000  52.599998  52.799999  21040927  50.425900
2018-04-27  53.700001  53.099998  53.200001  53.500000  19589914  51.094425
2018-04-30  54.000000  53.400002  53.799999  53.500000  10100426  51.094425
2018-05-02  53.799999  53.099998  53.200001  53.500000  12811907  51.094425
2018-05-03  53.799999  52.799999  53.299999  52.900002  11531521  50.521404
2018-05-04  53.000000  52.700001  52.700001  52.799999   7078223  50.425900
2018-05-07  53.400002  52.799999  53.400002  53.000000  14149062  50.616909
2018-05-08  53.500000  52.900002  53.000000  53.500000  13892667  51.094425
2018-05-09  53.799999  53.500000  53.500000  53.599998  13431774  51.189926
2018-05-10  53.799999  53.099998  53.599998  53.299999  16613918  50.903416
2018-05-11  54.700001  53.599998  53.599998  54.599998  26920084  52.144962
2018-05-14  55.000000  54.599998  54.799999  55.000000  14683155  52.526978
2018-05-15  55.099998  54.000000  55.000000  54.000000  18238343  51.571941
2018-05-16  55.000000  54.400002  54.599998  54.900002  18765990  52.431477
2018-05-17  55.400002  54.500000  55.000000  54.900002  14350081  52.431477
2018-05-18  54.900002  54.400002  54.900002  54.400002  15288612  51.953960
2018-05-21  55.000000  54.500000  54.599998  55.000000  11385495  52.526978
2018-05-22  55.000000  54.700001  54.900002  54.700001   9028106  52.240471
2018-05-23  55.099998  53.900002  55.000000  54.000000  12280601  51.571941
2018-05-24  54.500000  54.000000  54.400002  54.200001  10071640  51.762951
2018-05-25  54.400002  53.900002  54.299999  53.900002   9832938  51.476440
2018-05-28  54.200001  53.799999  53.900002  54.099998  10468660  51.667446
2018-05-29  54.400002  53.799999  54.099998  54.099998   8982523  51.667446
2018-05-30  53.500000  52.700001  53.500000  52.900002  26424947  50.521404
2018-05-31  53.799999  53.299999  53.500000  53.599998  34098025  51.189926
2018-06-01  53.700001  53.099998  53.599998  53.500000  10980132  51.094425

[98 rows x 6 columns]
國泰金
~ End ~

2017年12月21日 星期四

USB Devices Scanner

1. Download USB.zip file.

https://github.com/spyker729/bohan-debug-utility/raw/master/USB.zip

2. Excute USB.efi or forward to text file.

fs0:\> USB.efi
or
fs0:\> USB.efi > usb.txt
image

~ Thanks ~


2015年4月14日 星期二

How to Use svnsync Command to Backup SVN Repository ?

 

Platform : Ubuntu 14.04 LTS 64bits

 

1. Create a Null SVN Repository

# sudo svnadmin create Project_Name

 

2. Modify the content of pre-revprop-change file

# cd Project_Name/hooks/

# sudo cp  pre-revprop-change.tmpl pre-revprop-change

# sudo chmod +x pre-revprop-change

# sudo vim pre-revprop-change

=> The Last Line : exit 1

=> The Last Line : exit 0

 

3. Synchornize your SVN Repostiory from my google code project

# sudo svnsync init file:///home/svn/Project_Name https://bohan-debug-utility.googlecode.com/svn/ --username spyker729@gmail.com --allow-non-empty

 

# sudo svnsync sync file:///home/svn/Project_Name https://bohan-debug-utility.googlecode.com/svn --username spyker729@gmail.com

image

2015年2月13日 星期五

BDU v1.1.5 BIOS Utility for UEFI Shell

BDU v1.1.5 Supports the Following New Features :

1. Support Perpetual Calendar (萬年曆).

CMOS_0x0070_0x0071_000229_113725

CMOS_0x0070_0x0071_870729_000729

CMOS_0x0070_0x0071_141230_113320

2. Adjust the PCI Input Formats.

Bus: XXX (0-255) Dev: XX (0-31) Fun: X (0-7)

PCI Format

3. Fix Bus Section can't Enter 3 Digits.

4. Fix the Scan Algorithm For PCI List Function.

5. Add Century Prompt at CMOS (0x70/0x71).

Century

6. Fix the mmcfg_base Fetching Algorithm for Haswell and Broadwell Platform.

7. Add Qlogic, ASPEED and Broadwell PCI device name supports.

8. Remove the Auto-Refresh in PCI List, Menu, Help, SMBIOS, PCH Strap, and SYS Info to reduce the stress on Serial Port.

Download @ BDUEFI_V_1_1_5.zip
~ Thank you ~

2014年12月23日 星期二

BDU v1.1.4 BIOS Utility for UEFI Shell

BDU v1.1.4 supports the following features :

 

1. Support automatically generate a unique file name for every time of pressing F12 key to do screenshot capturing.

 

Format : FunctionName_YYMMDD_HHMMSS.bmp

iScreenshot_141223_101359

 

2. Support pop-up messages before BDU starts to capture a

screenshot.

PCI_B000_D031_F000_141223_101229Memory_0x000EDB70_141223_101240

IO_0x0000_141223_101247

CMOS_0x0070_0x0071_141223_101309ISA_0x0295_0x0296_141223_101313

Menu_141223_101318

Menu_141223_101320

Help_141223_101322

PCH_Straps_141223_101333

SIO_0x002E_0x002F_141223_101255

SIO_0x004E_0x004F_141223_101300

SIO_0x006E_0x006F_141223_101305

SystemInfo_141223_101336

PCI_LIST_141223_094720

PCI_LIST_141223_094725

PCI_LIST_141223_094727

3. File will be generated at your current folder, not root folder.

Ex : Current Folder : fs0:\BMP

=> File Place : fs0:\BMP\FunctionName_YYMMDD_HHMMSS.bmp

 

4. The default image size has changed from 800x600 to capture image depend on your current resolution.


Download @ BDUEFI_V_1_1_4.zip
~ Thank you ~

2014年12月19日 星期五

iScreenshot v0.0.3 for UEFI Shell

iScreenshoot v0.0.3 has the following changes :

 

1. Support automatically generate a unique file name for every time of pressing F12 key to do screenshot capturing.

 

Format : iScreenshot_YYMMDD_HHMMSS.bmp

 

2. Support pop-up messages before iScreenshot starts to capture a

screenshot.

 

3. File will be generated at your current folder, not root folder.

 

Ex : Current Folder : fs0:\BMP

=> File Place : fs0:\BMP\iScreenshot_YYMMDD_HHMMSS.bmp

iScreenshot_141219_162058

iScreenshot_141219_162107

iScreenshot_141219_163011

iScreenshot_141219_163016

Download @ iScreenshot_V_0_0_3.zip

~ Thank you ~

2014年12月17日 星期三

BDU v1.1.3 BIOS Utility for UEFI Shell

1. BDU v1.1.3 supports capturing a screenshot by pressing F12 key.

2. Fix input bug when pressing P key to configure address.

 

P.S. if you want to capture screen under UEFI shell. Please refer to here.

 

The following are the default file format :

iScreenshot (3)

Memory

PCI

IO

ISA

Help

Menu1

Menu

PCH_Straps

PCI_LIST

Download @ BDUEFI_V_1_1_3.zip
~ Thank you ~

iScreenshot for UEFI Shell

iScreenshoot supports automatically generate a unique file name for every time of pressing F12 key to do screenshot capturing.

Default resolution is 800 x 600 and will be generated “iScreenshot.bmp” file at your folder after the execution is complete.

iScreenshot (2)

iScreenshot

~ Thank you ~

2014年12月11日 星期四

Photo Viewer for UEFI Shell

How to use Photo Viewer ?
Shell > PhotoViewer.efi filename.bmp
Press “R” or “F5” Key to Refresh Screen !

123

456

789

DSC_1703

DSC_1704

Download @ Photo Viewer
~ Thank you ~

2014年11月25日 星期二

BDU v1.1.2 BIOS Utility for UEFI Shell


BDU v1.1.2 supports “System Information”.


 

Other modifications :

1. Support Broadcom PCIe devices.

2. Support LSI PCIe devices.

3. Support Matrox PCIe devices.

DSC_1585
DSC_1588
DSC_1590
~ Thank you ~

2014年9月17日 星期三

BDU v1.1.1 BIOS Utility for UEFI Shell

BDU v1.1.1 adds a new file format for Super I/O devices.
ISA : ISA_0xXXXX_0xXXXX.txt (X : Hexadecimal)
=> Super I/O with LDN : ISA_0xXXXX_0xXXXX_LDN_0xXX.txt
image
BDU v1.1.1 also has fixed the following bugs :
1. PCI List green cursor errors.
2. Remove surplus space for blue cursor.
3. Fix the algorithm of scanning PCI devices.
4. Update the device name database of PCI.
~ Thank you ~