[jira] [Commented] (ARROW-8642) Is there a good way to convert data types from numpy types to pyarrow DataType?
[ https://issues.apache.org/jira/browse/ARROW-8642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096569#comment-17096569 ] Anish Biswas commented on ARROW-8642: - Okay, I will do that from now on. > Is there a good way to convert data types from numpy types to pyarrow > DataType? > --- > > Key: ARROW-8642 > URL: https://issues.apache.org/jira/browse/ARROW-8642 > Project: Apache Arrow > Issue Type: Wish >Reporter: Anish Biswas >Priority: Major > > Pretty much what the title says. Suppose I have a numpy array and its a > numpy.int8 type. How do I convert it to a pyarrow.Datatype intuitively? I > thought a Dictionary lookup table might work but perhaps there is some better > way? > Why do I need this? I am trying to make pyarrow arrays with from_buffers(). > The first parameter is essentially a pyarrow.Datatype. So that's why. I have > validity_bitmaps as a buffer of uint8 and that's why I am using > from_buffers() and not pyarrow.array(). -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (ARROW-8642) Is there a good way to convert data types from numpy types to pyarrow DataType?
[ https://issues.apache.org/jira/browse/ARROW-8642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096567#comment-17096567 ] Wes McKinney commented on ARROW-8642: - [~trickarcher] if you have questions it's better to use the mailing list than to open JIRA issues > Is there a good way to convert data types from numpy types to pyarrow > DataType? > --- > > Key: ARROW-8642 > URL: https://issues.apache.org/jira/browse/ARROW-8642 > Project: Apache Arrow > Issue Type: Wish >Reporter: Anish Biswas >Priority: Major > > Pretty much what the title says. Suppose I have a numpy array and its a > numpy.int8 type. How do I convert it to a pyarrow.Datatype intuitively? I > thought a Dictionary lookup table might work but perhaps there is some better > way? > Why do I need this? I am trying to make pyarrow arrays with from_buffers(). > The first parameter is essentially a pyarrow.Datatype. So that's why. I have > validity_bitmaps as a buffer of uint8 and that's why I am using > from_buffers() and not pyarrow.array(). -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (ARROW-8642) Is there a good way to convert data types from numpy types to pyarrow DataType?
[ https://issues.apache.org/jira/browse/ARROW-8642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096278#comment-17096278 ] Anish Biswas commented on ARROW-8642: - Oh okay! That's neat! Thanks! > Is there a good way to convert data types from numpy types to pyarrow > DataType? > --- > > Key: ARROW-8642 > URL: https://issues.apache.org/jira/browse/ARROW-8642 > Project: Apache Arrow > Issue Type: Wish >Reporter: Anish Biswas >Priority: Major > > Pretty much what the title says. Suppose I have a numpy array and its a > numpy.int8 type. How do I convert it to a pyarrow.Datatype intuitively? I > thought a Dictionary lookup table might work but perhaps there is some better > way? > Why do I need this? I am trying to make pyarrow arrays with from_buffers(). > The first parameter is essentially a pyarrow.Datatype. So that's why. I have > validity_bitmaps as a buffer of uint8 and that's why I am using > from_buffers() and not pyarrow.array(). -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (ARROW-8642) Is there a good way to convert data types from numpy types to pyarrow DataType?
[ https://issues.apache.org/jira/browse/ARROW-8642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096272#comment-17096272 ] Joris Van den Bossche commented on ARROW-8642: -- There is a {{from_numpy_dtype}} function for this: {code} In [42]: pa.from_numpy_dtype(np.dtype("int8")) Out[42]: DataType(int8) {code} It's included in the API docs here: https://arrow.apache.org/docs/python/api/datatypes.html > Is there a good way to convert data types from numpy types to pyarrow > DataType? > --- > > Key: ARROW-8642 > URL: https://issues.apache.org/jira/browse/ARROW-8642 > Project: Apache Arrow > Issue Type: Wish >Reporter: Anish Biswas >Priority: Major > > Pretty much what the title says. Suppose I have a numpy array and its a > numpy.int8 type. How do I convert it to a pyarrow.Datatype intuitively? I > thought a Dictionary lookup table might work but perhaps there is some better > way? > Why do I need this? I am trying to make pyarrow arrays with from_buffers(). > The first parameter is essentially a pyarrow.Datatype. So that's why. I have > validity_bitmaps as a buffer of uint8 and that's why I am using > from_buffers() and not pyarrow.array(). -- This message was sent by Atlassian Jira (v8.3.4#803005)