netsec-lab/ex3/rep-14.py

13 lines
383 B
Python

import pandas as pd
'''
IMPORTANT: Remove leading space from column '# Bytes' in csv file or pandas
won't read it correctly.
'''
# Read dataset and fill missing rows with zeroes
dataset = pd.read_csv('csv/global_last10years.csv', index_col=0).fillna(0)
print('Correlations between different columns (NaNs replace with 0):')
print(dataset.corr(method='pearson').round(decimals=2))