Module 10
DataFrames
Tables for your data.
A table of data
A DataFrame is like a spreadsheet. It has columns (variables) and rows (observations).
Python
import pandas as pd
df = pd.DataFrame({"gene": ["A", "B", "C"], "gc": [54.2, 48.1, 60.0]})
print(df.columns)
print(len(df))→ Index(['gene', 'gc'], dtype='object')
3
Your task
Inspect a DataFrame
- Print columns and length of a DataFrame.