How to load a CSV file from the Mayavi GUI?

前端 未结 1 1140
温柔的废话
温柔的废话 2021-01-15 10:00

I know how to read the CSV into numpy and do it from a Python script, and that is good enough for my use case.

But since it has a GUI with data loading functionality

1条回答
  •  庸人自扰
    2021-01-15 10:39

    From the documentation

    One needs to have some data or the other loaded before a Module or Filter may be used. Mayavi supports several data file formats most notably VTK data file formats. Alternatively, mlab can be used to load data from numpy arrays. For advanced information on data structures, refer to the Data representation in Mayavi section.

    I've tested importing using the GUI on a Asus Laptop Intel CoreTM i7-4510U CPU @ 2.00 GHz with 8 GBs de RAM, using Windows 10, both in and out of a Python virtualenv and always got the same problem:

    It all points to CSV files not being directly supported, so had to find another workaround.

    My favorite was to use a virtual environment and install on it mayavi, jupyterlab, PyQt5 and Pandas.

    Then, using PowerShell, start a Jupyter notebook (jupyter notebook) > Upload > Select the .csv. This imported a 1,25 GBs (153543233 rows x 3 columns) .csv in around 20s, which then became available for usage.

    0 讨论(0)
提交回复
热议问题