-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfo.py
More file actions
26 lines (19 loc) · 645 Bytes
/
info.py
File metadata and controls
26 lines (19 loc) · 645 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
import sys
import os
import time
import webbrowser
import numpy as np
import pandas as pd
import pandas_profiling
if len(sys.argv[1]) < 1:
print('Error: No file path provided')
exit(1)
skiprows = 2
filepath = sys.argv[1]
filename = str(time.time()) + '-' + os.path.basename(filepath)
output_filepath = './info/' + filename + '.html'
df = pd.read_csv(filepath, parse_dates=True, encoding='UTF-8', skiprows=skiprows, dtype=np.float32)
profile = pandas_profiling.ProfileReport(df)
rejected_variables = profile.get_rejected_variables(threshold=0.9)
profile.to_file(outputfile=output_filepath)
webbrowser.open_new_tab(output_filepath)