Giter Site home page Giter Site logo

numpy array conversion to q about embedpy HOT 7 CLOSED

ghlian avatar ghlian commented on August 30, 2024
numpy array conversion to q

from embedpy.

Comments (7)

ghlian avatar ghlian commented on August 30, 2024

t[12]~np[:arange][*][12.]
t[12]~np[:arange;*][12.]
t[12]~np[:arange][*;12.]
t[12]~np[:arange;*;12.]
t[12]~np[:arange][12.]
t[12]~np[:arange;12.]

from embedpy.

ghlian avatar ghlian commented on August 30, 2024

used the test cases. the symbol is not shown in this post above t[12]~np[:arange][*][12.] get 0b

from embedpy.

Dianeod avatar Dianeod commented on August 30, 2024

Hi,

Could you please provide the code for what t is?

If t[12] is equivalent to the q function q)til 12 then the following should rectify the problem:

q)t:{til x}

q)t[12]~(np[:arange;*][12])
1b

Thanks,
Diane

from embedpy.

ghlian avatar ghlian commented on August 30, 2024

the codes are simply the testcases in embedPy/tests/syntax.t

All return 0b.
q)t[12] is working fine.

from embedpy.

ghlian avatar ghlian commented on August 30, 2024

however, in numpy 1.14.3 and q version 3.5 64bit, all the testcases return 1b.

from embedpy.

jhanna-kx avatar jhanna-kx commented on August 30, 2024

Hi,
I think there are were some issues with backticks "`" disappearing in the markdown.

I haven't been able to replicate this so far using the latest version of embedPy and kdb+ 3.6 on any of linux, macOS or windows.

Can you let us a few more details so we can try and replicate your issue.

  • Which OS?
  • Are you installing embedPy with the conda package?
  • If not using conda, was embedPy installed from a release from the releases page or cloned and built from source?
  • If you installed with a release, which version of embedPy was used?

Below is what I get by building from the latest version of the source (on linux in this case)

$ conda list numpy && conda list python
# packages in environment at /home/james/anaconda3/envs/py37:
#
# Name                    Version                   Build  Channel
numpy                     1.15.2           py37h1d66e8a_1  
numpy-base                1.15.2           py37h81de0dd_1  
# packages in environment at /home/james/anaconda3/envs/py37:
#
# Name                    Version                   Build  Channel
python                    3.7.0                hc3d631a_0  
$ q p.q
KDB+ 3.6 2018.06.01 Copyright (C) 1993-2018 Kx Systems
l64/ 8()core 64303MB ...

q)np:.p.import`numpy
q)t:"f"$til@
q)t[12]~np[`:arange][*][12.]`
1b
q)t[12]~np[`:arange;*][12.]`
1b
q)t[12]~np[`:arange][*;12.]`
1b
q)t[12]~np[`:arange;*;12.]`
1b
q)t[12]~np[`:arange][12.]`
1b
q)t[12]~np[`:arange;12.]`
1b
q)t[12]~np[`:arange][<]12.
1b
q)t[12]~np[`:arange;<]12.
1b
q)t[12]~np[`:arange][<;12.]
1b
q)t[12]~np[`:arange;<;12.]
1b
q)

from embedpy.

elopezaguilera avatar elopezaguilera commented on August 30, 2024

Closing this issue. We have been able to replicate the issue with the provided info. Feel free to reopen with details so that we can replicate the issue.

from embedpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.