-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataframe.h
37 lines (23 loc) · 897 Bytes
/
dataframe.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*dataframe.h
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <utility>
#include <sstream>
#include <stdexcept>
#include <math.h>
#include <sstream>
using namespace std;
class Dataframe{
public:
Dataframe();
Dataframe(string filename); //constructor that transforms our dataframe
void readFile(string filename); //take in a file and construct the Dataframe object
void writeToFile(string filename); //convert our Dataframe to a csv file named with the desired filename
vector<pair<string, vector<double>>> getData(); //get the private member variable _data
vector<double> getTime(); //this function returns the our time column
void addColumn(pair<string, vector<double>> column);
private:
vector<pair<string, vector<double>>> _data; //in our std::pair, the string holds the column name, and the vector<long double> holds our values.
};