Comments (1)
Hi, I think the simplest (or naivest, I'm not that familiar with pandas) solution is to convert the Dataframe to dictionary with records orientation, and use a Writer with dict struct representation.
import pyorc
import pandas as pd
output = open('test.orc', 'wb')
df = pd.DataFrame({
'num': [1,2,3,4],
'bool': [True, False, False, True],
'text': ['apple', 'pear', 'orange', 'grape']
})
writer = pyorc.Writer(output, "struct<num:int,bool:boolean,text:string>", struct_repr = pyorc.StructRepr.DICT)
writer.writerows(df.to_dict(orient="records"))
writer.close()
from pyorc.
Related Issues (20)
- How to edit the readme document? HOT 1
- Support for missing values in integer types HOT 2
- Installation on clean pypy3 environment fails: pybind11 missing HOT 5
- Reader can filter HOT 6
- pyorc.errors.ParseError: Footer is corrupt: types(1701470799) not exists HOT 2
- Invalid orc version
- Private Network Build HOT 2
- Possible to control filesize ? HOT 1
- Support for timestamp with local time zone HOT 2
- Add support to release Linux aarch64 wheels
- PyPI release for pyorc with orc v1.7.0 HOT 4
- set_metadata() casts to str() HOT 2
- Rec skips during sequencial reads HOT 2
- predicate to skip rows doesn't seem to work for timestamps HOT 6
- Apple Silicon Support? HOT 3
- can't find '__main__' module HOT 3
- orc Minimum is error? HOT 3
- Cannot install pyorc on Mac M1 HOT 2
- Please make python 3.11 wheels available from pypi HOT 1
- handle uniontype HOT 2
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 pyorc.