原创 Leetcode 1. Two Sum (Hashmap)
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assum
原创 python: 找到dataframe某列中含有特定字段字符串的行 & 遍歷dataframe & 函數返回爲空 & 找到特定單元格
題目描述: 6.) Proving Afzal Wrong We have detoured from the original aim of this question for long enough. Compare the popu
原创 樸素貝葉斯(Naive Bayes Classifier)相關參考資料鏈接
1. http://www.luyixian.cn/news_show_3477.aspx 改進樸素貝葉斯獨立性假設的方法講解 2. https://kns.cnki.net/KCMS/detail/detail.aspx?dbco
原创 python dataframe相關tips
1.將NaN替換爲0 # 將df出現的所有NaN替換爲0 df.fillna(0, inplace = True) # 將第一列出現的NaN替換爲0 df[0].fillna(0, inplace = True)
原创 Leetcode 1. Two Sum (C++ & Python)
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assum
原创 ERROR: The executable E:\路徑名稱\Scripts\python2.exe is not functioning
在用python3創建的virtualenv文件中,創建一個python2.7的virtualenv,以便python2和3可以來回切換。 解決方法:路徑全英文(╬▔皿▔)凸
原创 690. Employee Importance
You are given a data structure of employee information, which includes the employee's unique id, his importance value a
原创 pip Error: Fatal error in launcher: Unable to create process using '"'
一開始下的python2.7,後來下了python3,並且將python2的可執行文件改成python2.exe,將python3的pip命令改爲pip3令其與python2共存。後來因爲某些原因,我把python2.7卸了又重新下了一遍
原创 workon'提示"'workon' 不是內部或外部命令,也不是可運行的程序 或批處理文件。
情況:系統中同時存在Python2.7和Python3.7,環境變量使用Python3.7和Python3.7\Scripts。 在按照教程執行'pip install virtualenvwrapper'操作後,執行'workon'提示
原创 數據結構課程設計——圖結構
目錄 存儲結構 圖的遍歷 相關算法及其應用 存儲結構 鄰接矩陣 鄰接表 圖的遍歷 深度優先遍歷 bool edg[100][100]; bool visited[100]; memset(edg, 0, sizeof(edg)); me
原创 DFS&BFS模板
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #include <vector> #incl
原创 二分查找中mid取值注意
如果用mid=(left+right)/2,在運行二分查找程序時可能溢出超時。 因爲如果left和right相加超過int表示的最大範圍時就會溢出變爲負數。 所以如果想避免溢出,不能使用mid=(left+right)/2,應該使用m
原创 Two Stacks In One Array
6-1 Two Stacks In One Array (20 分) Write routines to implement two stacks using only one array. Your stack routines sho
原创 Quick Power
6-3 Quick Power (10 分) The function Power calculates the exponential function Nk. But since the exponential function
原创 Evaluate Postfix Expression
6-1 Evaluate Postfix Expression (25 分) Write a program to evaluate a postfix expression. You only have to handle four k