Giter Club home page Giter Club logo

3802ict-assignment-1's Introduction

This is a README file associated with DataFrame implemented in C++ Code

Below are possible interactions and ways to use the code. (Copy this code into main())

Example 1: The code in this example creates a dataframe, prints the dataframe to prove it is empty which prints nothing, then loads more data into the dataframe then sets all of the column names with names2. It will then add another column and delete the second column. the code then prints the dataframe to prove these operations have occured. it proceeds to perform the summary operation on the column titled 'hello' and prints the map returned

Code: vector<vector> vectors2 ={{20,4,4,1}, {0,0,0,0,0,1}, {0,0,0,1}};

vector<int> chars = {0,0,2,1};
string names2 [] = {"hello", "hi", "howdy"};
DataFrame<int> df;
df.printData();
df.load_data(vectors2);
df.set_columns(names2, 3);
df.add_data(chars, "hey");
df.printData();
printmap(df["hello"].summary());

Example 2: This code initalises the dataframe with a pre existing vector of vectors(vectors) it then sets the column names with names2 and changes one column name by the name itself and the index the code will then print the size and shape of the dataframe. we then call a column by index with [] operator and print the min for that line.

Code: vector<vector> vectors ={{20,4,4,1}, {0,0,0,0,0,1}, {-4,14,23,1}};

string names2 [] = {"hello", "hi", "howdy"};

DataFrame<int> df(vectors);
df.set_columns(names2, size(names2));
df.printData();
df.update_column("hello", "world");
df.update_column(1, "goodbye");
df.printData();
print("Size: ");
print(df.size());
println();
print("Shape: ");
print(df.shape());
println();
print("Min: ");
print(df[2].min());
println();

Example 3: This code will initalise the dataframe with a pre existing vector of vectors, it will then set the columns with names2, then printing the dataframe and proceeding to delete the column titled "hello" it will then print out the dataframe again before finishing

Code: vector<vector> vectors2 ={{20,4,4,1}, {0,0,0,0,0,1}, {0,0,0,1}};

string names2 [] = {"hello", "hi", "howdy"};
DataFrame<int> df;
df.load_data(vectors2);
df.set_columns(names2, 3);
df.printData();
df.delete_column("hello");
df.printData();

3802ict-assignment-1's People

Contributors

whall14 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.