ium_z444510/main.py

29 lines
598 B
Python
Raw Normal View History

2023-03-25 16:02:06 +01:00
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())