Replace NaNs with 0 in dataframe
This commit is contained in:
parent
4c05f0ccd7
commit
c4dc23a9f8
@ -9,7 +9,7 @@ IMPORTANT: Remove leading space from column '# Bytes' in csv file or pandas
|
|||||||
won't read it correctly.
|
won't read it correctly.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
dataset = pd.read_csv('./global_last10years.csv', index_col=0).dropna()
|
dataset = pd.read_csv('./global_last10years.csv', index_col=0).fillna(0)
|
||||||
|
|
||||||
# Convert unix timestamps to dates
|
# Convert unix timestamps to dates
|
||||||
timestamps = mdate.epoch2num(dataset.index)
|
timestamps = mdate.epoch2num(dataset.index)
|
||||||
@ -29,7 +29,7 @@ ts_uIPd = dataset.iloc[:,3]
|
|||||||
|
|
||||||
### rep-14: Signals correlation ###
|
### rep-14: Signals correlation ###
|
||||||
|
|
||||||
print('Correlations between different columns (NaNs filtered):')
|
print('Correlations between different columns (NaNs replace with 0):')
|
||||||
print(dataset.corr(method='pearson').round(decimals=2))
|
print(dataset.corr(method='pearson').round(decimals=2))
|
||||||
|
|
||||||
### rep-15: Destinations/Sources ratio ###
|
### rep-15: Destinations/Sources ratio ###
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user