Comments (9)
Yes
from dataframe.
There are a few ways of doing this:
If you have the whole data already in memory in one DataFrame, you can use slicing to get another DataFrame or another view (if you don't want a copy). In documentation look at get_[data|view]_by_...()
.
If you have the data in a file, you can read the file in chunks into multiple DataFrames. In documentation look at read()
.
from dataframe.
Thanks, if I get the view, could I do something like get_data_by_ on the view?
from dataframe.
Another question is that I want to first do groupby and then do the unique_value_count based on the group result. I should write my own visitor?
from dataframe.
template<typename T, typename I = unsigned long>
struct Unique_Value_Visitor {
using value_type = T;
using index_type = I;
using size_type = std::size_t;
using result_type = std::size_t;
explicit Unique_Value_Visitor(bool skipnan = true) : skip_nan_(skipnan) {}
inline void operator()(const index_type&, const value_type& val) {
unique_values_.insert(val);
}
PASS_DATA_ONE_BY_ONE
inline void pre() {
result_ = result_type{};
unique_values_.clear();
}
inline void post() {}
inline std::size_t get_result() const { return 0; }
private:
result_type result_;
const bool skip_nan_;
std::unordered_set unique_values_;
};
I write a visitor like call it by std::make_tuple("a", "b", Unique_Value_Visitor())) this while the result does not have the "b" column I debug it it could get into the get_res function
from dataframe.
I am not sure why you need a visitor. You can call the group-by and then call the unique column value on the result of group-by.
from dataframe.
I do groupby on column "a", and groupby could store the column "b" value as a vector for every "a", How should I do that?
from dataframe.
Read the group by documentation including its code samples
from dataframe.
Thanks I will try something new on my side first.
from dataframe.
Related Issues (20)
- StdVisitor error with user-defined type HOT 4
- in dynamic libraries, get_column returns an empty data vector HOT 10
- MedianVisitor giving wrong result HOT 2
- Issues while compiling with DataFrame headers HOT 4
- test failed HOT 2
- load_column from single_act_visit.get_result() HOT 3
- failed to compile tests and examples in ubuntu HOT 2
- The `DataFrame.h` occurred an error: `In included file: unknown type name 'requires'` HOT 3
- Compile Failed with `VERSION 2.0.0` HOT 3
- How can I convert the `Eigen Matrix` to `DataFrame` or `DataFrame` to `Eigen Matrix`? HOT 4
- Error compiling on Linux x86_64 with g++ 14.0.1 or Clang 17.0.6 HOT 3
- Question: Does this library support streaming data frames? HOT 3
- CLang 16.0.6 fails to build a file including `DataFrame/DataFrame.h` HOT 1
- INTERFACE_LINK_LIBRARY is missing `tbb` HOT 1
- Group by on string dataframe
- do get_data_by_isel on the view HOT 6
- gen_rand_tester HOT 1
- Problem about reading CSV with empty values. HOT 7
- Errors compiling the HelloWorld example HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataframe.