You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "bphillips-exos (via GitHub)" <gi...@apache.org> on 2023/04/20 18:27:50 UTC

[GitHub] [arrow] bphillips-exos commented on issue #35259: [Python] Pyarrow table conversion from pandas fails for categorical fields with arrow dtypes

bphillips-exos commented on issue #35259:
URL: https://github.com/apache/arrow/issues/35259#issuecomment-1516766375

   This does work actually, but it's a little unwieldy
   
   ```python
   df5 = df.assign(category=df['category'].astype(pd.ArrowDtype(pa.dictionary(pa.int8(), pa.string()))))
   pa.Table.from_pandas(df5, schema=schema)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org