Is there an equivalent for "dbutils.secrets.setToken"' in Python? - databricks

In Scala, with Databricks, it's possible to do dbutils.secrets.setToken(<value>).
Is there a way to do it with Python? When trying to do it, I receive this error:
'SecretsHandler' object has no attribute 'setToken'

To answer this question, dbutils.secrets.setToken can be used in Python but only when on-prem solutions.

Related

Source Finding Using TDOA in Python

I have recently gone through this paper. I want to implement it in python. I am not getting how to implement it. I am very new to this topic. I am not able to understand what equations have they used. I have read this but I am not able to relate this to the paper.
How to approach it using python? I want to build a function which can tell me the possible source location. Also, I am not able to understand the dataset also.

Using Concert Technology application or Callable Library application with CVXPY

I am looking at a two step approach for a optimization problem. My first step is using a MILP formulation of the problem and the second step involves using the solution from the first step as an initial solution but now with a MIQP formulation. I have been able to apply this concept in MATLAB using CPLEX. However, I am now trying the same using CVXPY with CPLEX as the solver. Now I know about the warm_start option but this does not work with the CPLEX solver. I am able to set CPLEX parameters but I am not sure how to initialize my solution. I am thinking of setting the ADVANCE START SWITCH parameter for CPLEX to 1, but now I need to set the initial solution. According to this page: http://www-eio.upc.es/lceio/manuals/cplex-11/html/usrcplex/solveMIP17.html, I need to use the method setVectors in a Concert Technology application, or by using CPXcopymipstart in a Callable Library application to set the initial solution. I am unsure of how to use this along with CVXPY.
The functionality you are looking for does not currently exist in CVXPY. CVXPY is a generic modeling layer that wraps around several solvers and it does not expose the CPLEX-specific CPXreadcopymipstarts nor CPXaddmipstarts functionality.
The fact that setting the value property of variables and using the warm_start option, as suggested in this answer, doesn't work, is a CVXPY issue. It looks like there is an open github issue for this here. In the future, this will likely be the intended solution to your general question.
For now, you'll have to use one of the CPLEX APIs directly. As you mentioned in the comments of this related stackoverflow question, you do not like the idea of using the lower-level CPLEX Python API. That leaves you with docplex as a viable option.

Is there any alternative for pandas.DataFrame function for Python?

I am developing an application for Android with Kivy, and package it with Buildozer. The core of my application is using pandas and specially the DataFrame function. It failed when I tried to package it with Buildozer even if I had put pandas in the requirements. So I want to use another library that can be used with Buildozer. So does anyone know about a great alternative to the pandas.DataFrame function with the numpy library for example or another one ?
Thanks a lot for your help. :)
Similar to Pandas.DataFrame.
As database you likely know SQLite (in python see SQLAlchemy and SQLite3).
On the raw tables (i.e., pure matrix-like) Numpy (Numpy.ndarray), it lacks of some database functionalities compared to Pandas but it is fast and you could easily implement what you need. You can find many comparisons between Pandas and Numpy.
Finally,depending on your needs, some simple python dictionaries, maybe OrderedDict.

Is there a straightforward way to use SQLAlchemy in Julia?

In connection with the question on ORM for Julia I am wondering how to get about using SQLAlchemy in Julia given that SQLAlchemy uses a lot of object/type magic to load and persist data. Do you have any hints how to use Julia structures in the context of SQLAlchemy?
(I am sorry, I am new to Julia, just looking around at this point and I am currently unable to come up with some code for a start - as MCVE).
The package PyCall.jl lets you load and use arbitrary python packages, including SQLAlchemy.
julia> using PyCall
julia> #pyimport sqlalchemy as sql
julia> sql.__version__
"1.1.9"
Please see it's documentation for further details.
As of now there are some arguably inconvenient syntax mappings necessary. Concretely, you must access python object fields and methods by object[:field] instead of object.field which you'd use in python. Nevertheless, since my pull request has been merged this week this is going to change once PyCall 2.0 is out! (Of course you can checkout the master branch through ] add PyCall#master and get this feature already now.)

Does IronRuby support Attributes?

I searched everywhere from google to this site but seems no answer for it. Does anyone know if IronRuby supports clr class attributes? If yes, how?
Thanks in advance.
There's no way to apply CLR attributes in IronRuby today. IronPython support it experimentally with its clrtype module, which uses its own way of overriding the underlying .NET class for a Python object.
If one would want to implement this in IronRuby themselves, it'd be a large undertaking, but not impossible. If anyone is interesting, please ask about it on the mailing list to get started.

Resources