
python
anniewwy
这个作者很懒,什么都没留下…
展开
-
python中调用java函数
【Ctrl+Shift+Alt+S】或者“File --> Project Structure --> Project Settings” 选择Artifacts选项卡,点击+号,选择"JAR --> From modules with dependencies…选择"Build --> Build Artifacts…--> %Project Name%:jar --> Build",在out文件夹中会生成该项目的jar文件。选择一个Main Class作为项目的启动文件,然后点OK。原创 2023-06-30 17:45:03 · 693 阅读 · 0 评论 -
python numpy 相关tips
1. 找到列表中重复次数最多的五个元素from collections import Counter# 统计出现次数num_times = Counter(test_list)# 将其根据出现次数(item[1])进行降序排序order_num = sorted(num_times.items(),key = lambda item:item[1], reverse = True)# 取重复次数最大的五项元素five_main_elements = np.zeros(5)for i原创 2021-03-24 10:12:36 · 138 阅读 · 0 评论 -
python TypeError: object of type ‘NoneType‘ has no len()
造成这个错误的原因多种多样,这次是因为stack我写成了self.stack = self.stack.append(i)然而append的返回是None原创 2020-10-31 22:09:00 · 1980 阅读 · 0 评论 -
python dataframe相关tips
1.将NaN替换为0# 将df出现的所有NaN替换为0df.fillna(0, inplace = True)# 将第一列出现的NaN替换为0df[0].fillna(0, inplace = True)原创 2020-05-05 16:59:59 · 303 阅读 · 0 评论 -
python: 找到dataframe某列中含有特定字段字符串的行 & 遍历dataframe & 函数返回为空 & 找到特定单元格
题目描述:6.) Proving Afzal WrongWe have detoured from the original aim of this question for long enough. Compare the popularity of dance music genres and pop music genres across the dataset using appropiate visualisation/s. Make the assumption that the pop原创 2020-05-25 22:46:46 · 8312 阅读 · 0 评论 -
workon'提示"'workon' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
情况:系统中同时存在Python2.7和Python3.7,环境变量使用Python3.7和Python3.7\Scripts。在按照教程执行'pip install virtualenvwrapper'操作后,执行'workon'提示"'workon' 不是内部或外部命令,也不是可运行的程序 或批处理文件。"且若执行'pip uninstall virtualenvwrapper'操作提示vi...原创 2019-06-06 09:22:18 · 8799 阅读 · 3 评论 -
pip Error: Fatal error in launcher: Unable to create process using '"'
一开始下的python2.7,后来下了python3,并且将python2的可执行文件改成python2.exe,将python3的pip命令改为pip3令其与python2共存。后来因为某些原因,我把python2.7卸了又重新下了一遍,却发现python2.7的pip命令一直显示Fatal error in launcher: Unable to create process using '"...原创 2019-06-04 22:15:25 · 180 阅读 · 0 评论 -
ERROR: The executable E:\路径名称\Scripts\python2.exe is not functioning
在用python3创建的virtualenv文件中,创建一个python2.7的virtualenv,以便python2和3可以来回切换。解决方法:路径全英文(╬▔皿▔)凸原创 2019-06-04 22:43:37 · 6053 阅读 · 0 评论