0

I have been working Python pandas DF. I usually Load a csv files, but at the same time I have excel files too. I find out pandas is very slow reading Excel files. I have JavaScript code that will convert from excel to csv. I am looking to way calling this script to automating conversion to csv to speed the pipeline. Basically do conversion behind scene. What is the best way to do this? I can share JS code anytime.

asked Mar 10, 2016 at 15:27
7
  • Do you have a way of running it from the command line? Commented Mar 10, 2016 at 15:28
  • @AmiTavory Unfortunately no, I using Anaconda spyder (Python 3.5) Commented Mar 10, 2016 at 15:31
  • I assume you've found this answer: stackoverflow.com/a/8284932/5276797. Commented Mar 10, 2016 at 15:39
  • Or better this one: stackoverflow.com/a/10136615/5276797 Commented Mar 10, 2016 at 15:45
  • @IanS I did found both of them. I am taking another look in PyV8, but still not sure if this will solve my problem. Thank you Commented Mar 10, 2016 at 15:47

2 Answers 2

1

start node app from python script explains how to use python subprocess to run a node.js script.

node.js runs javascript code on a v8 (chrome) engine. It's is easy to install on both Linux and Windows. There's an active SO tag, https://stackoverflow.com/questions/tagged/node.js

I like coffeescript as a way of writing javascript code with a syntax that is much more like Python.

I've see Python web stack questions (e.g. django) that talk about running javascript, though that might be on the client side rather than the serve.

answered Mar 10, 2016 at 16:38
Sign up to request clarification or add additional context in comments.

Comments

0

I follow subprocess method and it worked perfectly for me. Here is what I added to my code, order to run javascript code from python.

Import subprocess
subprocess.check_call(["cscript", "yourjsfile.js"])
answered Mar 11, 2016 at 14:31

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.