我使用 vite 创建了一个项目模板。
在package.json下,我看到了这个;
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview"
},
Run Code Online (Sandbox Code Playgroud)
vite和 和有什么区别vite preview?什么时候应该使用vite来代替vite preview?
与过去的java版本不同,java 11没有下载jre.运行一些基于java的软件时,我收到错误"没有java运行时环境".为了解决这个问题,我不得不安装java 8 jre.
鉴于没有更多的jre 11下载,如何让我的PC运行java 11 jre?
我使用的是Windows 10.
要检测python字符串是否以特定子字符串结尾,比如说".txt",有一个方便的内置python字符串方法;
if file_string.endswith(".txt"):
Run Code Online (Sandbox Code Playgroud)
我想检测一个python字符串是否以特定的子字符串开头"begin_like_this".我找不到一个方便的方法,我可以像这样使用;
if file_string.beginswith("begin_like_this"):
Run Code Online (Sandbox Code Playgroud)
我使用的是python v3.6
我在下面有这个功能;
def time_in_range(start, end, x):
"""Return true if x is in the range [start, end]"""
if start <= end:
return start <= x <= end
else:
return start <= x or x <= end
Run Code Online (Sandbox Code Playgroud)
函数参数均为日期时间类型。我想向函数添加输入提示。这就是我所做的;
def time_in_range(start: datetime, end: datetime, x: datetime) -> bool:
"""Return true if x is in the range [start, end]"""
if start <= end:
return start <= x <= end
else:
return start <= x or x <= end
Run Code Online (Sandbox Code Playgroud)
我收到错误NameError: name 'datetime' is not defined …
我有一个现有的解决方案,可以将一列的数据帧拆分为 2 列。
df['A'], df['B'] = df['AB'].str.split(' ', 1).str
Run Code Online (Sandbox Code Playgroud)
最近,我收到以下警告 FutureWarning: Columnar iteration over characters will be deprecated in future releases.
如何修复此警告?
我正在使用 python 3.7
我试图通过在pandas dataframe中创建scatter_matrix来显示一对图.这是创建配对图的方式:
# Create dataframe from data in X_train
# Label the columns using the strings in iris_dataset.feature_names
iris_dataframe = pd.DataFrame(X_train, columns=iris_dataset.feature_names)
# Create a scatter matrix from the dataframe, color by y_train
grr = pd.scatter_matrix(iris_dataframe, c=y_train, figsize=(15, 15), marker='o',
hist_kwds={'bins': 20}, s=60, alpha=.8, cmap=mglearn.cm3)
Run Code Online (Sandbox Code Playgroud)
我想显示对情节看起来像这样;
我使用的是Python v3.6和PyCharm,并没有使用Jupyter Notebook.
我正在使用python Anaconda.我很困惑这是将所有Anaconda软件包更新到最新版本的正确命令.似乎有2个命令可以使用;
$ conda update --all
Run Code Online (Sandbox Code Playgroud)
要么
$ conda update anaconda
Run Code Online (Sandbox Code Playgroud)
运行后者后,anaconda升级到ver4.4.随后,我运行前者,询问我是否要降级某些包.这让我很困惑.哪个是正确的命令?
我安装了一个新的anaconda v4.4.我意识到可以使用conda和pip安装python包.使用anaconda时使用pip安装python包而不是conda会有什么影响?pip安装的库是否会停止运行?我正在使用python v3
编辑:我不认为这个问题与pip和conda有什么区别? 这个问题解释了pip和conda之间的区别,但没有谈到在使用conda时使用pip的效果.
我想找出 conda 包的大小,以删除巨大且很少使用的包。我应该使用哪个 conda 命令来查找包大小?
conda list将列出包但不显示包大小。
我欢迎其他方法来确定包裹尺寸。
我使用的是 Windows 10。
我正在使用运行 python v3 的 64 位 python anaconda v4.4。我有 MS Access 2016 32 位版本。我想使用 pyodbc 让 python 与 Access 交谈。是否可以使用 64 位 pyodbc 与 MS Access 2016 32 位数据库通信?
我已经有许多使用 64 位 python anaconda 运行的 python 应用程序。降级到 32 位 python 将是一件苦差事。
python ×7
python-3.x ×5
anaconda ×3
pandas ×2
32bit-64bit ×1
conda ×1
dataframe ×1
java ×1
javascript ×1
ms-access ×1
odbc ×1
plot ×1
pyodbc ×1
string ×1
type-hinting ×1
vite ×1
vue.js ×1