Overview Version History Q & A Rating & Review
Excel Text to NumPy Array (VS Code Extension)
Convert text copied from Excel (tabular text) into Python np.array([...]) literals or LaTeX matrices.
Usage
Paste or type the Excel-copied table into a VS Code editor.
Select the table text.
Run one of the commands:
Excel: Convert Selection to NumPy Array
Excel: Convert Selection to LaTeX Matrix
Excel: Convert Selection to MATLAB Matrix
If no text is selected, the extension shows: No text selected.
Output examples
Input:
1 2
3 4
NumPy output:
np.array([[1, 2],
[3, 4]])
LaTeX output:
\begin{bmatrix}
1 & 2 \\
3 & 4
\end{bmatrix}
MATLAB output:
A = [1 2;
3 4];
Settings (excelToNumpy)
excelToNumpy.indentSpaces (number, default: 10)
excelToNumpy.useMultiline (boolean, default: true)
excelToNumpy.emptyCellValue ("None" | "nan" | "''", default: "None")
excelToNumpy.strictRectangular (boolean, default: false)
excelToNumpy.valueMode ("auto" | "string" | "float" | "raw", default: "auto")
excelToNumpy.dtype (string, default: "")
Value typing (auto)
Order: integer -> float -> boolean -> leading apostrophe string -> string.
Strings are emitted as Python single-quoted literals (NumPy) or escaped text (LaTeX) as needed.
Development
Install dependencies: npm install
Build: npm run compile
Test: npm test
Package: npm run package (produces a .vsix)