简短描述:AWS RDS 将服务器连接到 PgAdmin 4、PostgreSQL 11
完成:我已经完成了与此人或此aws 指南类似的操作,但最后当我单击“保存”时,它不接受我。而是给出以下内容
错误:
Error saving properties
Unable to connect to server:
timeout expired
Run Code Online (Sandbox Code Playgroud)
我试图解决的问题:
Your account does not support the EC2-Classic Platform in this region.
DB Security Groups are only needed when the EC2-Classic Platform is supported.
Instead, use VPC Security Groups to control access to your DB Instances.
Run Code Online (Sandbox Code Playgroud)
我有一个新的 EC2 Ubuntu 18.04 我已经安装了 anaconda,因为它在官方指南中 https://docs.anaconda.com/anaconda/install/linux/
apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2
libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6
libxtst6 64 bit installation
Run Code Online (Sandbox Code Playgroud)
但是我有 YML 文件,之前我曾在其他 EC2 上创建 conda 环境,当我厌倦了用它设置新环境时
ubuntu@ip........:~$ conda env create --name my_env_name --file=my_env_file.yml
它给了我以下错误
Collecting package metadata (repodata.json): / Killed
现在我正在尝试以下指南
import json
import pandas as pd
data = json.load(open('drug-label-0001-of-0008.json'))
df = pd.DataFrame(data)
Run Code Online (Sandbox Code Playgroud)
import pandas as pd
pd_example = pd.read_json('some_json_file.json')
Run Code Online (Sandbox Code Playgroud)
import pandas as pd
df = pd.read_json('drug-label-0008-of-0008.json')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-23-77b3c3e486fc> in …Run Code Online (Sandbox Code Playgroud) Jupyter Lab dask-labextension不起作用
均从以下位置安装:
conda install jupyterlab nodejs
conda install -c conda-forge dask-labextension
jupyter labextension install dask-labextension
jupyter serverextension enable dask_labextension
Run Code Online (Sandbox Code Playgroud)
错误
ERROR: "Dask Server Error Failed to list clusters: might the server extension not be installed/enabled?"buildBuild CompleteBuild successfully completed, reload page?点击->reload问题
尝试过的解决方案
WARNING The JupyterLab development team is excited to …这不是一个完整的 JavaScript 项目,如以下问题/答案:
这是一个简单的 Jupyter 笔记本/实验室扩展 python 包,名为“ jupyter-notify ”,它应该在单元完成运行后生成弹出的“浏览器通知”
以前它是通过安装的
pip install jupyternotify
细胞 1:
%load_ext jupyternotify
细胞 2:
%%notify
import time
time.sleep(5)
Run Code Online (Sandbox Code Playgroud)
单元 2 错误:
Javascript Error: $ is not defined
目标
描述错误
当我尝试时,import dask_cudf出现以下错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-11-afb970ad91bb> in <module>()
8 from dask_cuda import LocalCUDACluster
9 import dask_xgboost
---> 10 import dask_cudf
11 import dask
12 from xgboost.dask import DaskDMatrix
ModuleNotFoundError: No module named 'dask_cudf'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
我用 pip 安装了 …
FROM apache/airflow:2.4.1-python3.8
RUN python3 -m venv /opt/airflow/venv1
COPY requirements.txt .
RUN . /opt/airflow/venv1/bin/activate && pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
docker build -t my-image-apache/airflow:2.4.1 .
[+] Building 4.3s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.55kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> …Run Code Online (Sandbox Code Playgroud) 数据集 0-9 列:浮动特征(产品的参数) 10 列:int 标签(产品)
目标
计算标签的 0-1 分类确定性分数(这是我当前的代码应该做的)
为每行 (22'000) 的每个“product_name”(300 列)计算相同的确定性分数
错误我使用 sklearn.tree.DecisionTreeClassifier。我正在尝试使用“predict_proba”,但它给出了一个错误。
蟒蛇代码
data_train = pd.read_csv('data.csv')
features = data_train.columns[:-1]
labels = data_train.columns[-1]
x_features = data_train[features]
x_label = data_train[labels]
X_train, X_test, y_train, y_test = train_test_split(x_features, x_label, random_state=0)
scaler = MinMaxScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)
clf = DecisionTreeClassifier(max_depth=3).fit(X_train, y_train)
class_probabilitiesDec = clf.predict_proba(y_train)
#ERORR: ValueError: Number of features of the model must match the input. Model n_features is 10 and input n_features is 16722
print('Decision Tree …Run Code Online (Sandbox Code Playgroud) python classification machine-learning scikit-learn data-science
完毕
我只是想运行并复制以下项目:https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/。基本上到目前为止,我已经完成了链接项目中的所有操作,但我遇到了以下问题:
我自己的数据集 - 我尝试过使用数据框:
输入代码:
# reshape into X=t and Y=t+1
look_back = 1
trainX, trainY = create_dataset(train, look_back)
testX, testY = create_dataset(test, look_back)
# reshape input to be [samples, time steps, features]
trainX = numpy.reshape(trainX, (trainX.shape[0], 1, trainX.shape[1]))
testX = numpy.reshape(testX, (testX.shape[0], 1, testX.shape[1]))
# create and fit the LSTM network
model = Sequential()
model.add(LSTM(4, input_shape=(1, look_back)))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam')
model.fit(trainX, trainY, epochs=100, batch_size=1, verbose=2)
Run Code Online (Sandbox Code Playgroud)
输出错误:
--------------------------------------------------------------------------- …Run Code Online (Sandbox Code Playgroud) 我在 Django 项目标题区域的base.html文件中有以下代码。
{% if user.is_authenticated %}
<a class="nav-item nav-link" href="{% url 'create' %}"><span class="oi oi-plus"></span></a>
<a class="nav-item nav-link" href="javascript:{document.getElementById('logout').submit()}" onclick="">Logout</a>
<form id="logout" method="POST" action="{% url 'logout' %}">
{% csrf_token %}
<input type="hidden" />
</form>
{% else %}
<a class="nav-item nav-link" href="{% url 'signup' %}">Sign Up</a>
<a class="nav-item nav-link" href="{% url 'login' %}">Login</a>
{% endif %}
Run Code Online (Sandbox Code Playgroud)
我尝试注释掉 Javascript 区域 "{% url 'create' %}" 但它不起作用(出现错误是因为 'create' 代码块尚不存在):
<a class="nav-item nav-link" href="/*{% url 'create' %}*/"><span class="oi oi-plus"></span></a>
<!-- <a class="nav-item …Run Code Online (Sandbox Code Playgroud) 我正在关注如何在 Ubuntu 18.04 上使用 Postgres、Nginx 和 Gunicorn 设置 Django 指南。
\n\n我创建了以下文件 .socket
\n\nsudo nano /etc/systemd/system/gunicorn.socket
[Unit]\nDescription=gunicorn socket\n\n[Socket]\nListenStream=/run/gunicorn.sock\n\n[Install]\nWantedBy=sockets.target\nRun Code Online (Sandbox Code Playgroud)\n\n我创建了以下文件 .service
\n\nsudo nano /etc/systemd/system/gunicorn.service
指南中的原始 RECOMENDED_FORMATTING-s
\n\n[Unit]\nDescription=gunicorn daemon\nRequires=gunicorn.socket\nAfter=network.target\n\n\n[Service]\nUser=sammyRECOMENDED_FORMATTING\nGroup=www-data\nWorkingDirectory=/home/sammyRECOMENDED_FORMATTING/myprojectdirRECOMENDED_FORMATTING\nExecStart=/home/sammyRECOMENDED_FORMATTING/myprojectdirRECOMENDED_FORMATTING/myprojectenvRECOMENDED_FORMATTING/bin/gunicorn \\\n --access-logfile - \\\n --workers 3 \\\n --bind unix:/run/gunicorn.sock \\\n myprojectRECOMENDED_FORMATTING.wsgi:application\n\n[Install]\nWantedBy=multi-user.target\nRun Code Online (Sandbox Code Playgroud)\n\n我如何格式化自己的版本我的虚拟环境位于服务器上的项目文件夹之外
\n\n[Unit]\nDescription=gunicorn daemon\nRequires=gunicorn.socket\nAfter=network.target\n\n[Service]\nUser=SERVER_USER\nGroup=www-data\nWorkingDirectory=/home/SERVER_USER/MAIN_PROJECT_FOLDER\nExecStart=/home/SERVER_USER/ven/bin/gunicorn \\\n --access-logfile - \\\n --workers 3 \\\n --bind unix:/home/SERVER_USER/MAIN_PROJECT_FOLDER/MAINAPPLICATION_FOLDER.sock \\\n MAINAPPLICATION_FOLDER.wsgi:application\n\n[Install]\nWantedBy=multi-user.target\nRun Code Online (Sandbox Code Playgroud)\n\n我也尝试过按照最初的建议保留这些
\n\n--bind unix:/run/gunicorn.sock \\
比我尝试执行以下代码
\n\nsudo systemctl start gunicorn
错误信息1
\n\n …python ×9
python-3.x ×3
dask ×2
javascript ×2
jupyter ×2
jupyter-lab ×2
ubuntu-18.04 ×2
airflow ×1
amazon-ec2 ×1
comments ×1
conda ×1
css ×1
data-science ×1
dataframe ×1
django ×1
docker ×1
dockerfile ×1
gpu ×1
gunicorn ×1
html ×1
json ×1
keras ×1
linux ×1
lstm ×1
pandas ×1
pgadmin ×1
pgadmin-4 ×1
pip ×1
postgresql ×1
rapids ×1
scikit-learn ×1
tensorflow ×1
ubuntu ×1