atherkevin commented on issue #15133:
URL: https://github.com/apache/arrow/issues/15133#issuecomment-1372487119
The missing key! Thank you!
On Thu, Jan 5, 2023 at 9:58 AM Alenka Frim ***@***.***> wrote:
> Oh sorry, didn't check myself to be sure.
> Changing the type on the pandas side should work, like so:
>
> import pyarrow as paimport pandas as pd
> df = pd.DataFrame(({
> 'a': ['a', 'a', 'a', 'b', 'b', 'b', 'c'],
> 'b': [1, 2, None, 4, 5, 1, 0],
> 'c': [1.5, 2.0, 3.5, 5.0, 8.0, 10.0, 'a string'],
> }))df['c'] = df['c'].astype('str')
> pa.Table.from_pandas(df)# pyarrow.Table# a: string# b: double# c: string#
----# a: [["a","a","a","b","b","b","c"]]# b: [[1,2,null,4,5,1,0]]# c:
[["1.5","2.0","3.5","5.0","8.0","10.0","a string"]]
> df.to_feather('file')pd.read_feather('file')# a b c# 0 a
1.0 1.5# 1 a 2.0 2.0# 2 a NaN 3.5# 3 b 4.0 5.0# 4
b 5.0 8.0# 5 b 1.0 10.0# 6 c 0.0 a string
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/arrow/issues/15133#issuecomment-1372403747>,
> or unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/A4OTESXXLZD3DYNUXNZLT6TWQ3VTZANCNFSM6AAAAAATNFPU24>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]