Would anyone tell me why the y axix didn't show 0 and 8? I appreciate your help!
import pandas as pd
import numpy as np
import matplotlib.pyplot as pylot
from matplotlib import style
from sklearn.utils import shuffle
data = pd.read_csv("data.csv")
data.dropna()
data = data.dropna()
data = data.reset_index(drop=True)
style.use("ggplot")
p = "gene_A"
pylot.scatter(data[p], data["phenotype"])
pylot.xlabel(p)
pylot.ylabel("phenotype")
pylot.show()
CodePudding user response:
It's working fine for me. The most likely error is if you have formatting issues for datatype. Try running
data['phenotype'] = data['phenotype'].astype(float)