Python
文章平均质量分 67
LIQING LIN
这个作者很懒,什么都没留下…
展开
-
如何修改jupyter notebook的工作目录
右键-更多-打开文件位置,即可看到jupyter notebook 的快捷方式。这一行语句,即删除.py后的后缀内容。打开Anaconda Prompt,输入如下命令。右键-更多-打开文件位置,即可看到。位置,如果没有填y可以生成。原创 2024-10-20 20:23:27 · 610 阅读 · 0 评论 -
pandas.DataFrame.expanding or pandas.Series.expanding
expanding().mean(): 是一个。expanding().sum(): 是一个。expanding(): 是一个。值(或者缺失值),那么需要。值(或者缺失值),那么需要。原创 2023-04-17 23:32:34 · 305 阅读 · 0 评论 -
A Full Hardware Guide to Deep Learning
https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/#more-121https://blog.csdn.net/jiangjunshow/article/details/97894631Conclusion / TL;DRGPU: RTX 2070 or RTX 2080 Ti. GTX 1070, GTX 1080, GTX 1070 Ti, and GTX 1080 Ti from eBay are good to原创 2021-08-09 22:15:43 · 180 阅读 · 0 评论 -
python_单下划线_双下划线
Python does not support formal access control, but names beginning with a single underscore are conventionally akin to protected, while names beginning with a double underscore (other than special methods) are akin to private.Python 不支持正式的访问控制,但以单下划线开头的名原创 2021-07-16 01:10:33 · 140 阅读 · 0 评论 -
bool类型转int, 或者bool数组对象转int/float数组对象
bool value(one element) to intint(True)bool array to int array(np.array([True])).astype(np.int32)import numpy as np(np.array([True])).astype(np.float32)原创 2020-06-27 15:26:53 · 3643 阅读 · 0 评论 -
Jupyter notebook 如何显示行号,在没有Toggle line number的情况下, 以及不让Jupyter notebook的output输出窗口滚动,显示全部输出或隐藏
方法如下:鼠标左击 (left click) View,然后:点击键盘上的“L”键行号出现,如果想令行号消失,方法和令行号出现的方式一样!原创 2020-05-20 15:05:21 · 1573 阅读 · 0 评论 -
SAT Score Analyzer
You can download the data set from this link: http://catalog.data.gov/dataset/sat-results-e88d7If you take a quick look at the dataset, you will find a list of schools and their senior student SATre...原创 2019-10-29 15:42:29 · 227 阅读 · 0 评论 -
Reading the gps information from a image, using selenium or installing安装 PyQt5 to show the address
A image including GPS information2.#Anaconda Prompt#pip install exifreadimport exifreadimport reimport datetimedef convertToDegree(value): #GPS GPSLatitude : [40, 44, 609/25] ...原创 2019-10-25 07:41:05 · 294 阅读 · 0 评论 -
cp12_Excel Integration_Generating Workbooks(.xls and .xslx) 改变当前目录xlswings RunFrozenPython
import numpy as npimport pandas as pdimport xlrd, xlwtimport xlsxwriterpath='./' #current directoryGenerating Workbooks (.xls)a major drawback of xlwt is that it can only write spreadsheet fi...原创 2019-07-27 07:35:17 · 760 阅读 · 0 评论 -
Using OpenPyxl_ValueError: Row or column values must be at least 1
import openpyxl as oxlwb = oxl.Workbook()ws = wb.create_sheet(index=0, title='oxl_sheet')print(data)for r in range(data.shape[0]): for c in range(data.shape[1]): ws.cell(row=r, co...原创 2019-07-27 05:37:32 · 14760 阅读 · 1 评论 -
xlwt_Exception: Unexpected data type class 'numpy.int32'
for r in range(data.shape[0]): for c in range(data.shape[1]): ws_1.write(r,c,data[r,c])solution:for r in range(data.shape[0]): for c in range(data.shape[1]): ws_1.write(r...原创 2019-07-26 16:58:15 · 5631 阅读 · 0 评论 -
更改jupyter notebook主题
安装pipeasy_install pip其次点击 Anaconda Prompt然后pip install --upgrade jupyterthemes(有人说可以直接用 easy-intall来安装)安装好之后,在命令提示符中输入jt -l,可以查看主题:根据版本的不同可使用的主题会有所不同,我朋友的主题如下Available Themes:c...原创 2019-05-24 13:15:21 · 241 阅读 · 0 评论 -
String字符串问题
str and Unicodestr(byte flow)Unicode(string flow)ASCII(1 byte(7bits+1bit sign) represents 1char, most 127 chars) à ISO-8859-1(8bits,most 256 chars) à (GB: Chinese) GB2312 àGBK à GB18030 ...原创 2019-03-22 14:21:27 · 306 阅读 · 0 评论 -
numpy.loadtxt('iris.data.txt', delimiter = ',', converters ={4:read_label2})
data in iris.data.txt filesuch as:4.6,3.2,1.4,0.2,Iris-setosa5.3,3.7,1.5,0.2,Iris-setosa7.0,3.2,4.7,1.4,Iris-versicolor6.4,3.2,4.5,1.5,Iris-versicolor#########################################...原创 2019-02-20 08:48:41 · 2493 阅读 · 0 评论 -
Python 如何知道系统默认的编码,并设置系统默认编码 or 编码解码, 以及如何知道系统目录
如何知道系统默认的编码 import sys sys.getdefaultencoding() output:'utf-8' 设置系统默认编码 import sys reload(sys) sys.setdefaultencoding('utf8') 解码 然后编码 print( " china".decode...原创 2019-02-22 08:38:25 · 2164 阅读 · 0 评论 -
TypeError: can't concat str to bytes OR TypeError: cannot use a string pattern on a bytes-like obj
the differences between python2.x and python3.x as you tried to write words into a file#Under the python 3.xdef combineWordsFromFeed(filename): #with open(filename, 'w',encoding='utf-8') as...原创 2019-02-15 08:08:27 · 643 阅读 · 0 评论