作者查詢 / handsomeLin

總覽項目: 發文 | 留言 | 暱稱
作者 handsomeLin 在 PTT [ Python ] 看板的留言(推文), 共220則
限定看板:Python
[問題]使用遞迴解迷宮卻遇到stack overflow
[ Python ]15 留言, 推噓總分: +7
作者: ar0n77777 - 發表於 2018/04/28 10:40(7年前)
11FhandsomeLin: 因為你遞迴寫的方式會把整個MATRIX走滿 也就是100*1005/04 17:43
12FhandsomeLin: 0 在建立boundary情形下 先往j + 1走到底 j == 10005/04 17:45
13FhandsomeLin: 時又往下 i + 1下走 總而言之八成會繞完整個matrix05/04 17:46
14FhandsomeLin: 然後你not只用在一個條件下 估計走一走都是True05/04 17:54
15FhandsomeLin: 應該八成原本標記的1都會又會變成005/04 17:57
[問題] 關於open()
[ Python ]21 留言, 推噓總分: +6
作者: kiwistar - 發表於 2018/04/25 02:58(7年前)
3FhandsomeLin: 我是沒用過pycharm,但是如果是只打檔名的話會是當前04/25 03:00
4FhandsomeLin: 目錄找04/25 03:00
7FhandsomeLin: 解決辦法就是你打的那樣 都打絕對路徑確保不會出錯,04/25 08:19
8FhandsomeLin: 或者把檔案都丟在同一個folder裡基本上找的到,第二04/25 08:19
9FhandsomeLin: 個問題的解答是open default mode是r 也就是read 沒04/25 08:20
10FhandsomeLin: 東西當然不能read, 如果是寫的話就會幫你寫一個新04/25 08:20
11FhandsomeLin: 檔案出來04/25 08:20
[問題] List 回傳None
[ Python ]9 留言, 推噓總分: +4
作者: scott0528 - 發表於 2018/04/13 14:38(7年前)
3FhandsomeLin: You have already passed list into function, you c04/13 14:56
4FhandsomeLin: an just get final result from that list. Also, yo04/13 14:56
5FhandsomeLin: ur function doesn’t return any value, that’s wh04/13 14:56
6FhandsomeLin: y it print None04/13 14:56
8FhandsomeLin: BTW, this function can’t solve two lists with di04/13 14:59
9FhandsomeLin: fferent lengths.04/13 14:59
[問題] 一段語法詢問
[ Python ]16 留言, 推噓總分: +7
作者: gecer - 發表於 2018/04/08 18:45(7年前)
14FhandsomeLin: 你list裡也不會有key阿...感覺需重學data structure.04/11 01:03
[問題] 使用selenium.webdriver.Safari()失敗
[ Python ]20 留言, 推噓總分: +5
作者: clsmbstu - 發表於 2018/04/10 19:24(7年前)
3FhandsomeLin: 你的碼是自己敲的還是複製貼上的?04/10 23:37
4FhandsomeLin: 貼一下你的Code吧04/10 23:38
5FhandsomeLin: 現在手邊沒有電腦 你試試把他assign給一個variable04/11 00:16
6FhandsomeLin: 可以順便說一下selenium的版本嗎04/11 00:17
9FhandsomeLin: 剛查了個簡體網站,說Safari的webdriver默認是關閉得04/11 00:46
10FhandsomeLin: 去打開,試試吧04/11 00:46
Re: [問題] 讀取資料問題
[ Python ]8 留言, 推噓總分: +6
作者: AlaRduTP - 發表於 2018/03/30 19:51(7年前)
3FhandsomeLin: 用原生的方式沒啥不好吧 幹嘛一定得用numpy pandas03/31 16:39
[問題] 從資料擷取器抓取資料並及時繪圖
[ Python ]9 留言, 推噓總分: +3
作者: oway15 - 發表於 2018/03/23 18:09(7年前)
7FhandsomeLin: csv要已經有現檔才能開吧?並且用r的方式打開 這樣03/25 15:57
8FhandsomeLin: 應該不會造成什麼問題03/25 15:57
[問題] 新手寫while迴圈問題
[ Python ]32 留言, 推噓總分: +8
作者: wenyi420 - 發表於 2018/03/20 17:06(7年前)
9FhandsomeLin: 的確是第一位講的那樣,你recursive的呼叫自身函數,03/20 18:17
10FhandsomeLin: 在很多情況是不推薦的,尤其你這種簡單的函數,最簡03/20 18:17
11FhandsomeLin: 單的方式就是直接從while迴圈中break出來 然後詢問是03/20 18:17
12FhandsomeLin: 否繼續,或者更簡單的方式就是重新在while迴圈裡讓co03/20 18:17
13FhandsomeLin: unt=1 然後目標值重新取亂數 更簡單暴力,不過解法03/20 18:17
14FhandsomeLin: 很多看個人喜好吧03/20 18:17
15FhandsomeLin: 我講的第一種方式一樣是recursion但是最後一層猜中03/20 18:23
16FhandsomeLin: 之後 不會卡在while裡 或者原語句下面寫個return也03/20 18:23
17FhandsomeLin: 行03/20 18:23
20FhandsomeLin: 然後你重複的語句很多 猜大猜小可以用一句解決 新的i03/20 18:27
21FhandsomeLin: nput跟count+=1重複就拿出來一起用03/20 18:27
32FhandsomeLin: 是很爛的遞迴沒錯哈哈03/21 18:22
[問題] 機器學習--python求助 (訊飛盃code參考)
[ Python ]4 留言, 推噓總分: +3
作者: st474ddr - 發表於 2018/03/20 17:54(7年前)
2FhandsomeLin: Model重train過呢?03/20 18:12
4FhandsomeLin: 你有自己爬另外一個語料嗎 看來他有兩組?03/21 02:42
[問題] dict問題
[ Python ]32 留言, 推噓總分: +10
作者: st40182 - 發表於 2018/03/18 19:40(7年前)
13FhandsomeLin: 樓上j大 你這樣本身跟他用一組dict做出來的事一樣03/19 02:44
14FhandsomeLin: 順便提醒原po 你enumerate那不需要那樣子寫03/19 02:45
15FhandsomeLin: for i, v in enumerate(s) 就可以拿到index跟val了03/19 02:46
16FhandsomeLin: 不需要一個在list裡建tuple再把tuple取出來 太多餘03/19 02:47
17FhandsomeLin: a = list(d) b = [] for v in a: b.append(d[v])03/19 02:49
25FhandsomeLin: 第二種方法我是想說dict是unorder不知道直接取list會03/19 11:31
26FhandsomeLin: 不會沒對應到,不過第一種方法確實是不錯的 可以把b03/19 11:31
27FhandsomeLin: 縮成一行解決03/19 11:31
28FhandsomeLin: t大,我上面有補充他那段是可以簡化的03/19 11:33
32FhandsomeLin: 上了一課了03/19 18:57