29 lines
598 B
Python
29 lines
598 B
Python
|
import jupyter
|
||
|
import numpy as np
|
||
|
import pandas as pd
|
||
|
from sklearn.model_selection import train_test_split
|
||
|
import kaggle
|
||
|
import pandas
|
||
|
import os
|
||
|
|
||
|
path_to_data = './data'
|
||
|
|
||
|
|
||
|
def download_data():
|
||
|
kaggle.api.authenticate()
|
||
|
kaggle.api.dataset_download_files('thedevastator/airbnb-prices-in-european-cities', path=path_to_data, unzip=True)
|
||
|
|
||
|
|
||
|
def read_data_from_file(filename):
|
||
|
return pandas.read_csv(filename)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
if not os.path.isdir('data'):
|
||
|
download_data()
|
||
|
df = read_data_from_file(path_to_data + '/barcelona_weekends.csv')
|
||
|
print(df.head())
|
||
|
|
||
|
|
||
|
|