On Wed, Oct 24, 2012 at 10:29 AM, Jeff Allen <ja...py@farowl.co.uk> wrote:

On 24/10/2012 16:14, fwierzbicki@gmail.com wrote:

On Wed, Oct 24, 2012 at 8:01 AM, Doan Viet Dung <vietdung0181@yahoo.com> wrote:
Howerver when I started implement some methods that invoke the Pandas modules, the problems arrive.

    import types
  File "C:\Python27\lib\types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined

After some Google searchs, I am learning that Jython does not allow access to most Python extensions. Am I in this case ?
You haven't run into the lack of C-extensions support (so far), but you have run into the fact that Jython does not support the buffer protocol so far. There may be some hope in the future 2.7 as Jeff Allen (a relatively new contributor to Jython) has been working feverishly to implement the internal buffer API for Jython, which is a prerequisite for the exposed buffer protocol that we are missing and that pandas needs. I wish I could give you a timeframe on when we can support the buffer protocol, but this area of development is too new to give good predictions.

I'm now working feverishly on the _io module.
Drat - I knew that :)
The buffer API is mostly there (in the unreleased 2.7 code base that is) but I took my cue from the Python documentation that buffer was a legacy feature, and hoped not to add it. I think we just learned that important legacy code out there could run on Jython if we did.
It is true that a lot of code out there would run better if we had a buffer. On the other hand buffer ceases to exist in Python3 and memoryview is the right way to do things for new code or code that wants to interoperate between py2 and py3. In any case the buffer protocol would be a really nice to have if it isn't too much work.