Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
numpy_to_arrow.h
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 // Converting from pandas memory representation to Arrow data structures
19 
20 #ifndef ARROW_PYTHON_NUMPY_TO_ARROW_H
21 #define ARROW_PYTHON_NUMPY_TO_ARROW_H
22 
23 #include "arrow/python/platform.h"
24 
25 #include <memory>
26 
28 #include "arrow/util/visibility.h"
29 
30 namespace arrow {
31 
32 class Array;
33 class ChunkedArray;
34 class DataType;
35 class MemoryPool;
36 class Status;
37 
38 namespace py {
39 
51 ARROW_EXPORT
52 Status NdarrayToArrow(MemoryPool* pool, PyObject* ao, PyObject* mo, bool from_pandas,
53  const std::shared_ptr<DataType>& type,
54  const compute::CastOptions& cast_options,
55  std::shared_ptr<ChunkedArray>* out);
56 
67 ARROW_EXPORT
68 Status NdarrayToArrow(MemoryPool* pool, PyObject* ao, PyObject* mo, bool from_pandas,
69  const std::shared_ptr<DataType>& type,
70  std::shared_ptr<ChunkedArray>* out);
71 
72 } // namespace py
73 } // namespace arrow
74 
75 #endif // ARROW_PYTHON_NUMPY_TO_ARROW_H
Status NdarrayToArrow(MemoryPool *pool, PyObject *ao, PyObject *mo, bool from_pandas, const std::shared_ptr< DataType > &type, const compute::CastOptions &cast_options, std::shared_ptr< ChunkedArray > *out)
Convert NumPy arrays to Arrow.
Top-level namespace for Apache Arrow C++ API.
Definition: adapter.h:32
_object PyObject
Definition: serialize.h:30