How to import numkt (kotlin's numpy wrapper) into jupyter notebook to be used with kotlin kernel - numpy

I installed the kotlin kernel into my jupyter notebook environment using Anaconda. There are several libraries available by default like I can %use lets-plot
I'd really like to use the numpy wrapper which is sometimes called knumpy, kotlin-numpy or numkt
Import statements I see for the package include:
import org.jetbrains.numkt.*
import org.jetbrains.numkt.core.*
import org.jetbrains.numkt.math.*
from places like here
I can currently use the statement: %use numpy
and I get the error: Unresolved reference: numkt
I'd really like to get this functionality into my environment so I can actually do things.
How would I install/import this functionality into/from my anaconda environment.
Thnx

Remove all those imports and replace them with:
%use numpy
Here you can find knumpy very basic example.

Related

How do we do profiling in odoo16

As I know, we can use from odoo.tools.misc import profile or from odoo.tools.profiler import profile in odoo14 for profiling. They, however, are all deprecated in odoo16.
If I want to log my python method in odoo16, what tool should I use?

Migrating existing Karate project from Version 0.8.0 to 0.9.5

I'm trying to migrate existing Karate project from 0.8.0 to 0.9.5
but facing some issues like below
1)None of the below imports are working, Need to figure it out equalling ones from 0.9.5
Looking for help from other, who has already tried this
import com.intuit.karate.cucumber.CucumberUtils;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.cucumber.KarateFeature;
import com.intuit.karate.cucumber.KarateJunitAndJsonReporter;
import com.intuit.karate.cucumber.KarateJunitFormatter;
import com.intuit.karate.cucumber.KarateReporter;
import com.intuit.karate.cucumber.KarateRuntime;
import com.intuit.karate.cucumber.KarateRuntimeOptions;
import com.intuit.karate.cucumber.KarateStats;
import com.intuit.karate.filter;
2)import com.intuit.karate.cucumber.CucumberRunner;- stating as Deprecated already, need to know replacement of this, my baseClass extends CucumberRunner.
3)also need to know replacement for below also
import com.intuit.karate.cucumber.FeatureFilePath;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.ScriptContext;
above imports are using in parsing Feature file
public static FeatureFilePath parseFeaturePath(File file) {
Please suggest tips to get this migration done successfully.
Thank you,
Jay
Sorry, only KarateStats was designed as a public API which is replaced by com.intuit.karate.Results. And CucumberRunner is replaced by com.intuit.karate.Runner. These are clearly mentioned in the release notes for 0.9.0.
The core of Karate was completely written and things like the KarateFeature and FeatureWrapper don't even exist anymore. I would say whoever decided to use or extend these classes made a very bad decision, and we never documented or encouraged any such approach. All the best !

Pyinstaller returns fatal error when clicking on the built exe

I've built a digital LogBook for the laboratory that I work in as a PhD in Physics, so it's tailored to our needs. The code runs fine using tkinter for GUI , pandas and openpyxl so that the inserted data can be stored to an excel file. The problem is that I need to turn it into an exe (and specifically an exe for 32-bit from a 64-bit machine). I've used for other apps I've built, the pyinstaller and they work great, but for this one nothing seems to work. I've been searching a week now for a possible solution but I cannot seem to find a way out. Not to mention that many of what I'm reading as answers to similar question is like Greek to me, since I'm a newbie in Python. So, if there is anyone that can give me a clean-cut answer so that I can understand what I'm doing in the process, I would be grateful.
I'm working with Python 2.7.15 and Windows 10
Here are my imports:
from openpyxl import load_workbook
from openpyxl import Workbook
import pandas as pd
from openpyxl.utils.dataframe import dataframe_to_rows
from datetime import *
from tkinter import messagebox
import os
import tkinter.ttk

Pyspark not recognized by intellij even though visible in the configured Python SDK

The Python interpreter has been selected:
We can see that the pyspark were available (via pip) and visible to that python interpreter:
However the python interpreter does not recognize pyspark package:
pyspark is the only package that seems to suffer from this issue: pandas, numpy, sklearn etc all work. So what is different about pyspark ?
While the following is not really an answer to the original question, it is a middling - and only partial - workaround.
We need to add several environment variables to the Run configuration:
In particular the SPARK_HOME, PYTHON_SUBMIT_ARGS (=pyspark-shell), and PYTHONPATH are needed.
This is inconvenient to need to set for every pyspark run configuration .. but presents a last resort.

How do I call ipython modules in a short-hand way?

I'm learning python, and using notebooks;
My tutorial is telling my to use
randn(5)
but this only works for me when I use the fully qualified method; ie:
np.random.randn(5)
I imported numpy as np. Is there something else I need to do to make this work? I also wanted shorthand notation when calling plot() as well.
The tutorial likely assume that %pylab was called, or IPython was started with --pylab. The pylab magic does:
from pylab import *
which includes
from numpy import *
and other things, hiding where functions come from. The tutorial should probably not assume that you have done this, but if it does, it should be very clear about that fact, and mention what has happened and where these functions are coming from.
These days, it is typically considered prudent in teaching materials to make imports like this explicit, e.g.
import numpy as np
np.random.randn(x)
or
from numpy.random import randn
randn(x)
especially in a notebook, where saving a few characters of typing is much less precious than in a terminal.
When I use %pylab inline it works! Thanks