Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # coding: utf-8
- import pandas as pd
- import seaborn as sns
- df = pd.read_csv("https://www.dropbox.com/s/76fjhstb836quul/cars-search-data.txt?dl=1", sep=';' )
- df.head(5)
- df = df[pd.notnull(df['paliwo'])]
- df = df.drop(df.columns[4:], axis=1)
- df.head(4)
- df = df[~df.cena.str.contains("EUR")]
- df.cena = (df.cena.str.replace('PLN',''))
- df.cena = (df.cena.str.replace(',','.'))
- df.przebieg = df.przebieg.str.replace('km','')
- df.cena = df.cena.apply(pd.to_numeric)
- df.rocznik = df.rocznik.apply(pd.to_numeric)
- df.przebieg = df.przebieg.apply(pd.to_numeric)
- df = df[df.przebieg<500000]
- df.cena = df.cena / 1000
- df.head(10)
- sns.set_style('ticks')
- g = sns.regplot(x=df["rocznik"], y=df["przebieg"], fit_reg=True, marker="+", line_kws={"color":"r","alpha":0.7,"lw":2})
- g.figure.set_size_inches(18.5, 10.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement