DataFrames, plots, and visualizations
Now, it’s time to deal with DataFrames, so let’s comment on something and continue exploring widgets.
DataFrame is the name that the pandas library gives to its data. When a file, such as a CSV file, is imported into pandas, the result will be a DataFrame. We can think of a DataFrame as an Excel or Google Sheets table – that is, a piece of data made up of columns and rows. Columns are the features or variables and rows are the records or cases. So, to keep things simple, we can say that a DataFrame is a data structure made up of columns and rows.
First, we need to install pandas, with the following command:
pipenv install pandas
If you followed our suggestion and are using pipenv
for virtual environments, run the following command:
pip install pandas
If you are using a plain, standard Python installation, then write the following code:
st.header("Dataframes and Tables") import pandas as pd df =...