我一直致力于开发一种产品,该产品以数据分析 Python 3.7.0 脚本的日常执行为中心。每天午夜,它会处理大量数据,然后将结果导出到两个 MySQL 表中。第一个将只包含与当天相关的数据,而另一个表将包含所有执行的串联数据。
为了举例说明我目前拥有的内容,请参见下面的代码,假设df是从数据分析中生成的最终 DataFrame:
import pandas as pd
import sqlalchemy
engine = sqlalchemy.create_engine(r"mysql+pymysql://user:psswd@localhost/pathToMyDB")
df = pd.DataFrame({'Something':['a','b','c']})
df.to_sql('DReg', engine, index = True, if_exists='replace') #daily database
df.to_sql('AReg', engine, index = False, if_exists='append') #anual database
Run Code Online (Sandbox Code Playgroud)
正如您在我的第二个to_sql函数的参数中看到的那样,我没有为 anual 数据库设置索引。但是,我的经理要求我这样做,创建了一个以一个简单规则为中心的索引:它将是一个自动递增的数字索引,它会自动为数据库中保存的每一行与其位置相对应的行赋予一个数字。
所以基本上,我第一次保存时df,数据库应该是这样的:
index Something
0 a
1 b
2 c
Run Code Online (Sandbox Code Playgroud)
在我的第二次执行中:
index Something
0 a
1 b
2 c
3 a
4 b
5 c
Run Code Online (Sandbox Code Playgroud)
但是,当我True在第二个df.to_sql命令中将索引设置为时(将其转换为df.to_sql('AReg', engine, index = True, if_exists='append') …
所以,当谈到开发操作系统 AI 时,我很新,主要是使用 Microsoft Azure 的工具。我使用 Azure 的 QnA Maker Preview 来开发常见问题解答机器人。但就在今天,微软发布了一个 huuuuge 更新,使这个服务更加强大,与其他新功能一起添加了元数据的概念。我知道它应该让你的系统更强大、更快速和更智能,但我不明白它应该如何使用以及它究竟做了什么。谁能帮我理解这个新工具?谢谢!
artificial-intelligence machine-learning azure azure-qna-maker
我已经使用 Power BI 很长时间了,每次需要使用数据网关时,我都会使用安装在我的个人计算机中的网关。
但最近我被要求在虚拟机中托管本地数据网关,所以我想知道:是否可以在 AWS EC2 实例中安装和配置本地数据网关?如果是这样,我该怎么办?
我也考虑过使用 AWS Workspace,但考虑到价格,我宁愿使用 EC2。
在我工作的公司中,我被要求使用 AWS 的新推送通知服务 Amazon Pinpoint 进行一些测试。
我决定遵循亚马逊的教程,教如何构建一个能够记录笔记的简单应用程序。它很简单并且工作完美,所以我决定继续学习我的新简单程序来接收推送通知。
问题是,我从来没有用Java编程过,所以,在遵循这个的过程中,我陷入了最后一步。我真的不确定将这部分代码放在哪里:
import com.amazonaws.mobileconnectors.pinpoint.PinpointConfiguration;
import com.amazonaws.mobileconnectors.pinpoint.PinpointManager;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID;
public class MainActivity extends AppCompatActivity {
public static final String LOG_TAG = MainActivity.class.getSimpleName();
public static PinpointManager pinpointManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (pinpointManager == null) {
PinpointConfiguration pinpointConfig = new PinpointConfiguration(
getApplicationContext(),
AWSMobileClient.getInstance().getCredentialsProvider(),
AWSMobileClient.getInstance().getConfiguration());
pinpointManager = new PinpointManager(pinpointConfig);
new Thread(new Runnable() {
@Override
public void run() {
try {
String deviceToken =
InstanceID.getInstance(MainActivity.this).getToken(
"123456789Your_GCM_Sender_Id",
GoogleCloudMessaging.INSTANCE_ID_SCOPE);
Log.e("NotError", …Run Code Online (Sandbox Code Playgroud) 最近,我一直在尝试使用Power BI REST API通过调用 .ps1 程序来自动刷新某个数据集。通过遵循本教程,我能够获得此代码,如下所示:
$groupID = "me" # the ID of the group that hosts the dataset. Use "me" if this is your My Workspace
$datasetID = "MYDATASETID" # the ID of the dataset that hosts the dataset
$clientId = "MYCLIENTID"
# Calls the Active Directory Authentication Library (ADAL) to authenticate against AAD
function GetAuthToken
{
if(-not (Get-Module AzureRm.Profile)) {
Import-Module AzureRm.Profile
}
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$resourceAppIdURI = "https://analysis.windows.net/powerbi/api" …Run Code Online (Sandbox Code Playgroud) powerbi ×2
amazon-ec2 ×1
aws-pinpoint ×1
azure ×1
data-gateway ×1
dataframe ×1
java ×1
mysql ×1
pandas ×1
powershell ×1
python ×1
rest ×1
sqlalchemy ×1