我正在查询MongoDB集合,有两个查询并附加它们以获取单个数据框。(键是:status,date,uniqueid)
<apex:page standardController="account">
<apex:form>
<apex:pageBlock title="Block One">
<apex:pageBlockSection title="Entry Section">
<apex:inputField value="{!account.Name}"/>
<apex:inputField value="{!account.phone}"/>
<apex:inputField value="{!account.billingcity}"/>
<apex:inputField value="{!account.Industry}"/>
<apex:commandButton value="Submit" action="{!save}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
输出是:
for record in results:
query1 = (record["sensordata"]["user"])
df1 = pd.DataFrame(query1.items())
query2 = (record["created_date"])
df2 = pd.DataFrame(query2.items())
index = "status"
result = df1.append(df2, index)
b = result.transpose()
print b
b.to_csv(q)
如何在行和列中删除这些额外的0,1,2和0,1? 此外,我不希望每次都有状态uniqueid和日期重复。 我想要的输出应该是这样的:
0 1 2
0 status uniqueid date
1 0 191b117fcf5c 2017-03-01 17:51:08.263000
0 1 2
0 status uniqueid date
1 1 191b117fcf5c 2017-03-01 17:51:17.216000
0 1 2
0 status uniqueid date
1 1 191b117fcf5c 2017-03-01 17:51:23.269000
0 1 2
0 status uniqueid date
1 1 191b117fcf5c 2017-03-01 18:26:17.216000
0 1 2
0 status uniqueid date
1 1 191b117fcf5c 2017-03-01 18:26:21.130000
0 1 2
0 status uniqueid date
1 0 191b117fcf5c 2017-03-01 18:26:28.217000