ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

python ¿Ä¸ê¿Ä¨é·JÁ` (¥þ³¡)"¸ê®Æ

¥»©«³Ì«á¥Ñ koshi0413 ©ó 2016-9-29 19:31 ½s¿è

¦^´_ 40# c_c_lai

¹ï«¨   ªdªº¥DÁä©O??????????????
©Ç¤F¡A¤p§Ì¤]¨S³o±¡ªp¤]@@
¤£¹L³q±`¤p§Ì¥u«Ø¥ß¯Á¤Þ   ¨S«Ø¥ß¥DÁä    ³o¤è­±¥i¥H½Ð±Ð j¤j

µ¥µ¥¡A­è¤~¬Ý¤F¤@¤U¦Û¤vªº¡A ¤]¤@¼Ë¡Ac¤j  ª½±µ¥hÂI¦UªÑªí®æ¬Ý¬Ý

32213.jpg (53.27 KB)

32213.jpg

32213.jpg (65.62 KB)

32213.jpg

TOP

¦^´_ 40# c_c_lai

¤£¦n·N«ä¡A¤£¬O«Ü©ú¥Õ§Aªº·N«ä¬O¤°»ò¡H¥i¥HÁ|¦C»¡©ú¶Ü¡H¦]¬°§Ú¨S¦b¾Þ§@³]²¼¡A©Ò¥H¹ï³o¡A¤£©ú¥Õ

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-9-30 07:43 ½s¿è

¦^´_ 42# lpk187
¤£¦n·N«ä¡A§Ú¬O»¡µ{¦¡¤¤¦p¦ó¥h«Ø¥ß¯Á¤ÞÀÉ (Primary Key, Secondary Key µ¥)¡A
¦b¤U¤@¦¸°õ¦æ®É¡A«K¯à§PÂ_¬O§_¬°­«½Æ (Duplicate) Key ­È¡A¦Ó¥h°õ¦æ Update °Ê§@¡A
¤Ï¤§°õ¦æ Insert ªº °Ê§@¡C¦p¦¹«K¯à¥¿±`¦a¥hºûÅ@»P¤F¸Ñ¸ê®Æ®wªº¹B¥Î¤F¡C
Python ¥¿ÁÙ¦b¾Ç²ß¤¤¡A½Ñ¦h´£°ÝÁٽЦh¦h«ü±Ð¡I

TOP

¦^´_ 43# c_c_lai

¦b­ì¨Óµ{§Ç¤¤¡A«Ø¥ß¸ê®Æªí®É¡A´N³£¦³«Ø¥ß¥DÁä (Primary Key)¡A©Ò¥H¬O¤£·|¦³­«½Æ­Èªº¡A
sql = "CREATE TABLE ªÑ²¼(ªÑ²¼¥N¸¹  char(10) PRIMARY KEY,....
sql="CREATE TABLE [" + i + "](¤é´Á  DATETIME PRIMARY KEY, \
­Y¦³¥²­n«Ø¥ß¥~¨ÓÁä(Secondary Key)¡A¥i¥H§ï¦¨
sql="CREATE TABLE [" + i + "] (¤é´Á DATETIME PRIMARY KEY  REFERENCES [0050] (¤é´Á), \
¥t¥~SQLite3´N¦³«Ø¥ß¯Á¤Þ

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2016-9-30 10:03 ½s¿è

¦^´_ 35# c_c_lai

¦bsqlite3¤¤ ¥Î sql»yªk¡A¦³¨Ç³\¤£¦P¡A´N¬O¸ê®Æªí­n¥Î [ ] ¤¤¬A¸¹
  1. import sqlite3 as lit
  2. import pandas as pd

  3. conn = sqlite3.connect('twsedata.sqlite')
  4. data=pd.read_sql('select * from [0050]',conn)
  5. conn.close()
  6. data
½Æ»s¥N½X

TOP

¦^´_ 45# lpk187
¨S¿ù¡I ¶·¥[¤W [ ... ] ¤~¦æ¡C
¦p¦¹ pandas ªº¶×¤J¤]¸Ñ¨M¤F¡C
ÁÂÁÂÅo¡I

TOP

¦^´_ 44# lpk187
³o³¡¤À§Ú¦A¸Õ¸Õ¬Ý¡AÁÂÁ¶O¤ß¡I

TOP

¦^´_  lpk187
¨S¿ù¡I ¶·¥[¤W [ ... ] ¤~¦æ¡C
¦p¦¹ pandas ªº¶×¤J¤]¸Ñ¨M¤F¡C
ÁÂÁÂÅo¡I
c_c_lai µoªí©ó 2016-9-30 12:34

c¤j
¥i§_½Ð±Ð¤@¤U¡A¦bpython¨ú¥X¸ê®Æsql  ¬O­n¦b pythonª½±µµe¹Ï¹À¡H³t«×¸û§Ö¡HÁÙ¬O³æ¯Â½m²ß©O¡H
¦]¬°¬Ý¹Lªdªº¤å³¹¬O¥Îvbaµe

ps:¥Ø«e¤p§Ìªº·Qªk¬O   python§ì¨ú¸ê®Æ¦Üsqlite3¡Avba±qsqlite3¨ú¥X¸ê®Æ
³æ¯Â¥æ¬y¤@¤U·Qªk

TOP

¦^´_ 44# lpk187
¸g¤ñ¹ï«á©lµo²{¤£µL­«½ÆÁä­È¡F¦Ó¬O²Ä¤@¦¸°õ¦æ®É
³¡¦ì¨Ì¦¸§¹¥þ¼g¤J¡A¦A²Ä¤G¦¸°õ¦æ®Éµo²{±q Rec#104«á
¤S¦³·sªº¬ö¿ý¼g¤J¡A¤~ı±o³Y²§¡C
¸g¤j¤j¦A¦¸¤ÀªR¸Ñ»¡¡A¦A¦¸¸ê®Æ¤ñ¹ï¤~µo²{¨ä¬°·s­È¡C

²{¦bªº°ÝÃD¬O¡G ²Ä¤@¦¸ªì©l¸ê®Æ¼g¤J®É¹H©M·|¬O¤£§¹¾ã¡H

TOP

c¤j
¥i§_½Ð±Ð¤@¤U¡A¦bpython¨ú¥X¸ê®Æsql  ¬O­n¦b pythonª½±µµe¹Ï¹À¡H³t«×¸û§Ö¡HÁÙ¬O³æ¯Â½m²ß©O¡H
¦]¬°¬Ý ...
koshi0413 µoªí©ó 2016-9-30 14:43

¨ä¹ê§A´£¨ìªº ¡G
"¥Ø«eªº·Qªk¬O   python §ì¨ú¸ê®Æ¦Ü sqlite3¡Avba ±q sqlite3 ¨ú¥X¸ê®Æ"
¦b¹ê°È¤W³oºØ¤è¦¡¡A¥u¯à·í§@¬O ¡yÀx³Æ§@·~¡z¡A´£¨Ñ§@¬° ¡u¾ú¥v¸ê®Æ¬d¸ß¡v¡F
¡y½u¤W§Y®É§@·~¡z¬O Excel ª½±µ»P¨é°Ó DDE ³sµ²Ą̊ú¸ê°T¡Aª½±µ¶i¦æø¹Ï¤ÀªR¡F
°£«D Python ¤]´£¨ÑÃþ¦ü¦p¦¹¤§¥\¯à (³sµ²¨é°ÓDDE)¡F±µ¤U¨Ó³z¹L
Candlestick OHLC graphs with Matplotlib ¨Ó³B²z¡C

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD