DataSetPro

 avatar
unknown
python
2 years ago
598 B
2
Indexable
import numpy as np
import pandas as pd
data = "DataSetPro.csv"
headers = ["Rank", "Name", "Platform", "Year", "Genre", "Publisher", "NA_Sales", "EU_Sales", "JP_Sales", "Other_Sales", "Global_Sales"]
df = pd.read_csv(data, on_bad_lines='skip', names=headers)
styler = df.style.background_gradient(subset=pd.IndexSlice[3:12])
df.columns = headers

df.replace("?", np.nan, inplace = True)
df.replace(" ", np.nan, inplace = True)
df.dropna(subset=["Year"], axis=0, inplace=True)

df['Year'].apply(str)
df = df.astype({'Year':'int'}, errors = 'ignore')

print(df.info())

print(df.head(5))

breakpoint()