add main.py

This commit is contained in:
s444510 2023-03-25 16:02:06 +01:00
parent 606666da7b
commit f3ff46f349

28
main.py Normal file
View File

@ -0,0 +1,28 @@
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())