Import CSV and convert into Matrix

Import CSV and convert into Matrix

uw115
Explorer Explorer
1,308 Views
2 Replies
Message 1 of 3

Import CSV and convert into Matrix

uw115
Explorer
Explorer

Hi All, 

 

I was wondering if anyone could help me in finding a way to import a CSV file into the Fusion 360 API. The CSV is of a 5x5 matrix generated on Matlab which I need to feed into my API in order to perform further logic in generating a design. It requires me to perform some array indexing, the best way I know how is to use Numpy but I am unsure how to go about installing Numpy. 

 

Thanks in advance

Usman

0 Likes
Accepted solutions (2)
1,309 Views
2 Replies
Replies (2)
Message 2 of 3

goyals
Autodesk
Autodesk
Accepted solution

Fusion comes with its own python installation with some standard packagaes and I do not think you can install any new module there. But you can append the path of the locations where numpy is located on your machine using

 

import sys

sys.path.append(path to numpy)

 

I understand numpy comes with very good functionality to works with Matrix but if you want to consider, standard python installation comes with csv module to read csv files so you can use that like

 

import csv

csv.read



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 3

uw115
Explorer
Explorer
Accepted solution

Thanks for this, in the end, I changed the format of the data coming from my csv file to read the list numbers like a matrix. It would be great to have some more inbuilt functionality in Fusions version of Python that allows us to utilise the greater mathematical computing provided by numpy, but a workaround was found for now. 

 

Thanks

0 Likes