|
5 | 5 |  |
6 | 6 |
|
7 | 7 | # Panda-Helper: Quickly and easily inspect data |
8 | | -Panda-Helper is a simple data-profiling utility for Pandas' DataFrames and Series. |
| 8 | +Panda-Helper is a simple, open-source, Python data-profiling utility for Pandas' DataFrames and Series. |
9 | 9 |
|
10 | 10 | Assess data quality and usefulness with minimal effort. |
11 | 11 |
|
12 | 12 | Quickly perform initial data exploration, _so you can move on to more in-depth analysis_. |
13 | 13 |
|
14 | | ------ |
15 | | -### DataFrame profiles: |
16 | | -- Report shape |
17 | | -- Detect duplicated rows |
18 | | -- Display series names and data types |
19 | | -- Calculate distribution statistics on null values per row providing a view on data completeness |
20 | | - |
21 | | -__Sample DataFrame profile__<br> |
22 | | -_Vehicles passing through toll stations_ |
23 | | - |
24 | | - DataFrame-Level Info |
25 | | - ------------------------- ------------ |
26 | | - DF Shape (1586280, 6) |
27 | | - Duplicated Rows 2184 |
28 | | - |
29 | | - Column Name Data Type |
30 | | - -------------------------- ----------- |
31 | | - Plaza ID int64 |
32 | | - Date object |
33 | | - Hour int64 |
34 | | - Direction object |
35 | | - # Vehicles - ETC (E-ZPass) int64 |
36 | | - # Vehicles - Cash/VToll int64 |
37 | | - |
38 | | - Summary of Nulls Per Row |
39 | | - -------------------------- ----------- |
40 | | - count 1.58628e+06 |
41 | | - min 0 |
42 | | - 1% 0 |
43 | | - 5% 0 |
44 | | - 25% 0 |
45 | | - 50% 0 |
46 | | - 75% 0 |
47 | | - 95% 0 |
48 | | - 99% 0 |
49 | | - max 0 |
50 | | - median 0 |
51 | | - mean 0 |
52 | | - median absolute deviation 0 |
53 | | - standard deviation 0 |
54 | | - skew 0 |
55 | | - |
56 | | ------ |
57 | | -### Series profiles report the: |
58 | | -- Series data type |
59 | | -- Count of non-null values in the series |
60 | | -- Number of unique values |
61 | | -- Count of null values |
62 | | -- Counts and frequency of the most and least common values |
63 | | -- Distribution statistics for numeric-like data |
64 | | - |
65 | | -__Sample profile of categorical data__<br> |
66 | | -_Direction vehicles are traveling_ |
67 | | - |
68 | | - Direction Info |
69 | | - ---------------- ------- |
70 | | - Data Type object |
71 | | - Count 1586280 |
72 | | - Unique Values 2 |
73 | | - Null Values 0 |
74 | | - |
75 | | - Value Count % of total |
76 | | - ------- ------- ------------ |
77 | | - I 814100 51.32% |
78 | | - O 772180 48.68% |
79 | | - |
80 | | -__Sample profile of numeric data__<br> |
81 | | -_Hourly vehicle counts at tolling points_ |
82 | | - |
83 | | - # Vehicles - ETC (E-ZPass) Info |
84 | | - --------------------------------- ------- |
85 | | - Data Type int64 |
86 | | - Count 1586280 |
87 | | - Unique Values 8987 |
88 | | - Null Values 0 |
89 | | - |
90 | | - Value Count % of total |
91 | | - ------- ------- ------------ |
92 | | - 0 3137 0.20% |
93 | | - 43 1762 0.11% |
94 | | - 44 1743 0.11% |
95 | | - 40 1712 0.11% |
96 | | - 42 1699 0.11% |
97 | | - 41 1682 0.11% |
98 | | - 39 1676 0.11% |
99 | | - 37 1673 0.11% |
100 | | - 48 1659 0.10% |
101 | | - 46 1654 0.10% |
102 | | - 38 1646 0.10% |
103 | | - 45 1641 0.10% |
104 | | - 36 1636 0.10% |
105 | | - 52 1574 0.10% |
106 | | - 47 1572 0.10% |
107 | | - 50 1571 0.10% |
108 | | - 51 1555 0.10% |
109 | | - 53 1547 0.10% |
110 | | - 55 1543 0.10% |
111 | | - 34 1534 0.10% |
112 | | - 8269 1 0.00% |
113 | | - 8438 1 0.00% |
114 | | - 8876 1 0.00% |
115 | | - 8261 1 0.00% |
116 | | - 8694 1 0.00% |
117 | | - |
118 | | - Statistic Value |
119 | | - ------------------------- --------------- |
120 | | - count 1.58628e+06 |
121 | | - min 0 |
122 | | - 1% 25 |
123 | | - 5% 68 |
124 | | - 25% 407 |
125 | | - 50% 1054 |
126 | | - 75% 2071 |
127 | | - 95% 3583 |
128 | | - 99% 6308 |
129 | | - max 16854 |
130 | | - median 1054 |
131 | | - mean 1373.16 |
132 | | - median absolute deviation 751 |
133 | | - standard deviation 1253.1 |
134 | | - skew 1.69154 |
135 | | - |
136 | | ------ |
137 | | -### Installing Panda-Helper |
138 | | -`pip install panda-helper` |
139 | | - |
140 | | ------ |
141 | | -### Using Panda-Helper |
142 | | -__Profiling a DataFrame__<br> |
143 | | -Create the DataFrameProfile and then display it or save the profile. |
144 | | -```python |
145 | | -import pandas as pd |
146 | | -import pandahelper as ph |
147 | | - |
148 | | -data = { |
149 | | - "user_id": [1, 2, 3, 4, 4], |
150 | | - "transaction": ["purchase", "return", "purchase", "exchange", "exchange"], |
151 | | - "amount": [100.00, None, 1400.00, 85.12, 85.12], |
152 | | - "survey": [None, None, None, "online", "online"], |
153 | | -} |
154 | | -df = pd.DataFrame(data) |
155 | | -df_profile = ph.DataFrameProfile(df) |
156 | | -df_profile |
157 | | -``` |
158 | | - |
159 | | - DataFrame-Level Info |
160 | | - ------------------------- ------ |
161 | | - DF Shape (5, 4) |
162 | | - Obviously Duplicated Rows 1 |
163 | | - |
164 | | - Column Name Data Type |
165 | | - ------------- ----------- |
166 | | - user_id int64 |
167 | | - transaction object |
168 | | - amount float64 |
169 | | - survey object |
170 | | - |
171 | | - Summary of Nulls Per Row |
172 | | - -------------------------- -------- |
173 | | - count 5 |
174 | | - min 0 |
175 | | - 1% 0 |
176 | | - 5% 0 |
177 | | - 25% 0 |
178 | | - 50% 1 |
179 | | - 75% 1 |
180 | | - 95% 1.8 |
181 | | - 99% 1.96 |
182 | | - max 2 |
183 | | - median 1 |
184 | | - mean 0.8 |
185 | | - median absolute deviation 1 |
186 | | - standard deviation 0.83666 |
187 | | - skew 0.512241 |
188 | | - |
189 | | -```python |
190 | | -df_profile.save_report("df_profile.txt") |
191 | | -``` |
192 | | - |
193 | | -__Profiling a Series__<br> |
194 | | -Create the SeriesProfile and then display it or save it. That's it! |
195 | | -```python |
196 | | -series_profile = ph.SeriesProfile(df["amount"]) |
197 | | -series_profile |
198 | | -``` |
199 | | - amount Info |
200 | | - ------------- ------- |
201 | | - Data Type float64 |
202 | | - Count 4 |
203 | | - Unique Values 3 |
204 | | - Null Values 1 |
205 | | - |
206 | | - Value Count % of total |
207 | | - ------- ------- ------------ |
208 | | - 85.12 2 50.00% |
209 | | - 100 1 25.00% |
210 | | - 1400 1 25.00% |
211 | | - |
212 | | - Statistic Value |
213 | | - ------------------------- ---------- |
214 | | - count 4 |
215 | | - min 85.12 |
216 | | - 1% 85.12 |
217 | | - 5% 85.12 |
218 | | - 25% 85.12 |
219 | | - 50% 92.56 |
220 | | - 75% 425 |
221 | | - 95% 1205 |
222 | | - 99% 1361 |
223 | | - max 1400 |
224 | | - median 92.56 |
225 | | - mean 417.56 |
226 | | - median absolute deviation 7.44 |
227 | | - standard deviation 654.998 |
228 | | - skew 1.99931 |
229 | | - |
230 | | -```python |
231 | | -series_profile.save_report("amount_profile.txt") |
232 | | -``` |
233 | | -____ |
234 | | -### Sample data obtained from: |
235 | | -- https://data.ny.gov/Transportation/Hourly-Traffic-on-Metropolitan-Transportation-Auth/qzve-kjga/data |
236 | | -- https://data.cityofnewyork.us/Public-Safety/Motor-Vehicle-Collisions-Crashes/h9gi-nx95 |
| 14 | +Please see [project website](https://ray310.github.io/Panda-Helper/). |
0 commit comments