-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.py
More file actions
37 lines (22 loc) · 663 Bytes
/
try.py
File metadata and controls
37 lines (22 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# read data from file
import csv
import numpy as np
import matplotlib.pyplot as plt
import collections
from collections import Counter
import csv
data_file = "arabian_sea200602.pix"
#rowValue = input("Enter the row value")
rowValue = 4
result = []
with open(data_file,'r') as f:
reader = csv.reader(f, delimiter=' ')
for row in reader:
temp = float(row[rowValue])
result.append(temp)
# Get all the keys of the list and store it in a tuple
newData = Counter(result)
# make the data ordered
od = collections.OrderedDict(sorted(newData.items()))
keys = list(newData.keys())
# calculate mean and stanard devaition for the data