通过熊猫数据框进行打印

时间:2019-03-14 01:02:41

标签: python pandas

尝试将dataframe元素传递到我正在测试的格式化打印笔记中,以便稍后发送电子邮件。

我正在尝试获取“注释:”列下的最后一行数据,并将其插入打印功能,如下所示:

#include <iostream>
#include <vector>
using namespace std;

class Test
{
public:
    Test(int data1, int data2) :data1(data1), data2(data2) 
    {
        cout << "Normal Constructor" << endl; 
    }
    Test(const Test& src)
    {
        cout << "Copy Constructor" << endl;
        this->data1 = src.data1;
        this->data2 = src.data2;
    }
    Test(Test&& rhs)
    {
        cout << "Move Constructor" << endl;
        this->data1 = rhs.data1;
        this->data2 = rhs.data2;
        rhs.data1 = 0;
        rhs.data2 = 0;
    }
    Test& operator=(const Test& src)
    {
        if (this == &src)
            return *this;
        cout << "Copy assignment operator" << endl;
        this->data1 = src.data1;
        this->data2 = src.data2;
        return *this;
    }
    Test& operator=(Test&& rhs) 
    {
        if (this == &rhs)
            return *this;
        cout << "Move assignment operator" << endl;
        this->data1 = rhs.data1;
        this->data2 = rhs.data2;
        rhs.data1 = 0;
        rhs.data2 = 0;
        return *this;
    }
    private:
        int data1, data2;
    };

int main()
{
    vector<Test> vec;
    for (int i = 0; i < 5; i++)
    {
        cout << "Iteration  " << i << endl;
        vec.push_back(Test(100, 100));
        cout << endl;
    }
}

但是我的错误出来了:

def report(data):
  print("""
  Cash up by: 
  Card: 
  Cash: 
  Variance: 
  Total: 
  Petty Cash: 
  Director Tab: 
  Comp Total: 
  Wastage: 
  Notes: %s
  Tank Notes: 
  Close Checks Performed: 

  """, %(data["Notes:"].iloc[-1]))

^ SyntaxError:语法无效

0 个答案:

没有答案