Interactive demo | demos/3-csv

Intro

Loads csv file in, removes the header and plots histograms of
the first and second column.
Run
Server offline
Idle

Parameters

Result

(none yet)

Sample api request

Source code

def endpoint(csvFile:bytes=petal, mode:["Undescript columns", "Petal columns"]="Petal columns") -> PIL.Image.Image:
    """Loads csv file in, removes the header and plots histograms of
the first and second column.

:param csvFile: csv file"""
    fig = plt.figure()
    petal | file() | toCsv() | ~head(1) | cut(0, 1) | toFloat().all() | transpose() | aS(plt.hist, bins=30).all() | ignore()
    plt.legend(["Column 1", "Column 2"] if mode == "Undescript columns" else ["Sepal length", "Sepal width"]);
    plt.xlabel("Value"); plt.ylabel("Frequency"); return plt.gcf() | toImg()