Post · 1 min read· pp. 1012–1013

aerosandbox.tools.webplotdigitizer_reader

A series of utilities for working with CSV data extracted from WebPlotDigitizer.

https://automeris.io/WebPlotDigitizer/ https://github.com/ankitrohatgi/WebPlotDigitizer

Functions

string_to_float(s)Converts a string input to a float. If not possible, returns NaN.
remove_nan_rows(a)Removes any rows in a 2D ndarray where any of the entries are NaN.
read_webplotdigitizer_csv(filename)Reads a CSV file produced by WebPlotDigitizer (https://automeris.io/WebPlotDigitizer/).

Module Contents

aerosandbox.tools.webplotdigitizer_reader.string_to_float(s) : Converts a string input to a float. If not possible, returns NaN.

code
Parameters:
:   **s** (*str*) –

Return type:
:   float

aerosandbox.tools.webplotdigitizer_reader.remove_nan_rows(a) : Removes any rows in a 2D ndarray where any of the entries are NaN.

code
Parameters:
:   **a** (*numpy.ndarray*) –

Return type:
:   numpy.ndarray

aerosandbox.tools.webplotdigitizer_reader.read_webplotdigitizer_csv(filename) : Reads a CSV file produced by WebPlotDigitizer (https://automeris.io/WebPlotDigitizer/).

code
If there’s only one data series, produces a Dict with key “data” and value 2D ndarray.

If there are multiple data series, produces a Dict with keys of the names and values of 2D ndarrays.

2D ndarrays are sorted by their X-values before being returned.

Parameters:
:   **filename** (*Union**[**pathlib.Path**,* *str**]*) – Filename, as a string or pathlib Path, or equivalent.

Return type:
:   Dict[str, numpy.ndarray]

Returns: A dictionary where keys are series names and values are data points.