Skip to main content

General Discussion on Python

Description

Area for general discussion on using Python with IDEA.

Problem sending variables to Client.RunPythonEx

I had someone come to me with a problem in which they were using the Client.RunPythonEx to send variables to their python script. Every time they ran their script the had the following error: "Python generated the following error: EOL while scanning string literal". What they were trying to do was to send the working directory to python using the RunPythonEx. So there code was something like this:

How to delete rows or remove duplicates with python

Hi Brian
I wanted to know if it is possible for me to apply python scripts to remove duplicates from a table. I would like to consider all columns (more than 100 columns) as duplicates.
I know how to write a function; the problem is I should add a column and apply the function in that column. I would like to apply Python scripts to whole table.
For instance, apply this Python script in a table; data.drop_duplicates(keep=False)
Or delete rows with python
 
Thanks,
 

Working with Databases

Good morning,
The scenario I am in is one in which IDEA,  I am using version 12, takes in a database, "send" it to Python to do something (mainly cruching data using Pandas) and then "receives" back a different one once the data crunching is done.  
I would be very grateful if you could direct me to some source to understand how Python access Idea DB and how then Idea can access the Python output.
I have watched videos and browsed around the IdeaLab but could noy find any clear guidance.
Thank you very much in advance for your help.
Vito

How to obtain the Working Directory of an IDEA's project

Hello everyone!!
Does anyone know how to obtain the working directory of an IDEA's project using python?
I tried the code below but it raised an error " 'str' object is not callable"
import win32com.client as win32ComClient
idea = win32ComClient.Dispatch="Idea.IdeaClient")
wd = idea.WorkingDirectory()
 
 

Import custom functions

Hi everyone,
I have written several .py files and tried to import them to my main file. The program works on terminal; however when I try to run it on IDEA it doesn't work. It halts at "Python script is running" and nothing happens. I put all the files in Macros.ILB, but sstill don't work. Should I put them on a different directory?
Thanks in advance.

No module named 'seaborn'

Hello all,
I created a script in python which is supposed to generate a Bar chart using matplotlib. The module I am using for visualization is seaborn. While the script works perfectly when i invoke it from the editor and from command prompt, it gives the error 'No module named seaborn' whi i invoke it inside a macro. The module is however installed and working fine even when used in other scripts. I have spent three days trying to figure out whatthe problem could be to no avail.
 
Anyone who experienced this problem and was able to fix it?