pandas-plots 0.11.12__tar.gz → 0.11.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.11.12
3
+ Version: 0.11.14
4
4
  Summary: A collection of helper for table handling and vizualization
5
5
  Home-page: https://github.com/smeisegeier/pandas-plots
6
6
  Author: smeisegeier
@@ -29,6 +29,8 @@ Requires-Dist: requests>=2.32.0
29
29
  Requires-Dist: numpy<2.0.0
30
30
  Requires-Dist: missingno>=0.5.2
31
31
  Requires-Dist: duckdb>=1.0.0
32
+ Requires-Dist: kaleido>=0.2.1
33
+ Requires-Dist: nbformat>=4.2.0
32
34
 
33
35
  # pandas-plots
34
36
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pandas-plots
3
- version = 0.11.12
3
+ version = 0.11.14
4
4
  author = smeisegeier
5
5
  author_email = dexterDSDo@googlemail.com
6
6
  description = A collection of helper for table handling and vizualization
@@ -35,6 +35,8 @@ install_requires =
35
35
  numpy < 2.0.0
36
36
  missingno >= 0.5.2
37
37
  duckdb >= 1.0.0
38
+ kaleido >= 0.2.1
39
+ nbformat >= 4.2.0
38
40
 
39
41
  [egg_info]
40
42
  tag_build =
@@ -311,7 +311,8 @@ def show_package_version(
311
311
  items.append(f"📦 {item}: {version}")
312
312
  except md.PackageNotFoundError:
313
313
  items.append(f"❌ {item}: Not found")
314
- print('\n',sep.join(items))
314
+ out = sep.join(items).strip()
315
+ print(out)
315
316
  return
316
317
 
317
318
  class OperatingSystem(Enum):
@@ -320,32 +321,34 @@ class OperatingSystem(Enum):
320
321
  MAC = auto()
321
322
 
322
323
 
323
- def get_os(desired_os: OperatingSystem = None) -> bool:
324
+ def get_os(is_os: OperatingSystem = None, verbose: bool = False) -> bool | str:
324
325
  """
325
- A function that checks the operating system and returns a boolean value based on the desired operating system.
326
+ A function that checks the operating system and returns a boolean value based on the operating system to check.
326
327
 
327
328
  Parameters:
328
- desired_os (OperatingSystem): The desired operating system to check against. Defaults to None.
329
+ is_os (OperatingSystem): The operating system to check against. Defaults to None.
329
330
  Values are
330
331
  - OperatingSystem.WINDOWS
331
332
  - OperatingSystem.LINUX
332
333
  - OperatingSystem.MAC
333
334
 
334
335
  Returns:
335
- bool: True if the desired operating system matches the current operating system, False otherwise. Returns None if desired_os is None.
336
+ bool: True if the desired operating system matches the current operating system, False otherwise.
337
+ str: Returns the current operating system (platform.system()) if is_os is None.
336
338
  """
337
- print(
338
- f"💻 os: {os.name} | 🎯 system: {platform.system()} | 💽 release: {platform.release()}"
339
- )
339
+ if verbose:
340
+ print(
341
+ f"💻 os: {os.name} | 🎯 system: {platform.system()} | 💽 release: {platform.release()}"
342
+ )
340
343
 
341
- if desired_os is None:
342
- return None
344
+ if is_os is None:
345
+ return platform.system()
343
346
 
344
- if desired_os == OperatingSystem.WINDOWS and platform.system() == "Windows":
347
+ if is_os == OperatingSystem.WINDOWS and platform.system() == "Windows":
345
348
  return True
346
- elif desired_os == OperatingSystem.LINUX and platform.system() == "Linux":
349
+ elif is_os == OperatingSystem.LINUX and platform.system() == "Linux":
347
350
  return True
348
- elif desired_os == OperatingSystem.MAC and platform.system() == "Darwin":
351
+ elif is_os == OperatingSystem.MAC and platform.system() == "Darwin":
349
352
  return True
350
353
  else:
351
354
  return False
@@ -96,11 +96,10 @@ def describe_df(
96
96
  df[col] = df[col].astype(str)
97
97
 
98
98
  print(f"🔵 {'*'*3} df: {caption} {'*'*3}")
99
- print(f"🟣 shape: ({df.shape[0]:_}, {df.shape[1]}) columns: {df.columns.tolist()} ")
99
+ print(f"🟣 shape: ({df.shape[0]:_}, {df.shape[1]}) columns: {np.array(df.columns)} ")
100
+ # print(f"🟣 shape: ({df.shape[0]:_}, {df.shape[1]}) columns: {df.columns.tolist()} ")
100
101
  print(f"🟣 duplicates: {df.duplicated().sum():_}")
101
102
  print(f"🟣 missings: {dict(df.isna().sum())}")
102
- print("--- column uniques (all)")
103
- print(f"🟠 index {wrap_text(df.index.tolist()[:top_n_uniques])}")
104
103
 
105
104
  def get_uniques_header(col: str):
106
105
  # * sorting has issues when col is of mixed type (object)
@@ -114,18 +113,17 @@ def describe_df(
114
113
  return unis, header
115
114
 
116
115
  # * show all columns
117
- for col in df.columns[:]:
118
- _u, _h = get_uniques_header(col)
119
- if use_columns:
116
+ if use_columns:
117
+ print("--- column uniques (all)")
118
+ print(f"🟠 index {wrap_text(df.index.tolist()[:top_n_uniques])}")
119
+ for col in df.columns[:]:
120
+ _u, _h = get_uniques_header(col)
120
121
  # * check col type
121
122
  is_str = df.loc[:, col].dtype.kind == "O"
122
123
  # * wrap output
123
124
  print(
124
125
  f"{_h} {wrap_text(_u[:top_n_uniques], max_items_in_line=70, use_apo=is_str)}"
125
126
  )
126
- # print(f"{_h} {_u[:top_n_uniques]}")
127
- else:
128
- print(f"{_h}")
129
127
 
130
128
  print("--- column stats (numeric)")
131
129
  # * only show numerics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.11.12
3
+ Version: 0.11.14
4
4
  Summary: A collection of helper for table handling and vizualization
5
5
  Home-page: https://github.com/smeisegeier/pandas-plots
6
6
  Author: smeisegeier
@@ -29,6 +29,8 @@ Requires-Dist: requests>=2.32.0
29
29
  Requires-Dist: numpy<2.0.0
30
30
  Requires-Dist: missingno>=0.5.2
31
31
  Requires-Dist: duckdb>=1.0.0
32
+ Requires-Dist: kaleido>=0.2.1
33
+ Requires-Dist: nbformat>=4.2.0
32
34
 
33
35
  # pandas-plots
34
36
 
@@ -8,3 +8,5 @@ requests>=2.32.0
8
8
  numpy<2.0.0
9
9
  missingno>=0.5.2
10
10
  duckdb>=1.0.0
11
+ kaleido>=0.2.1
12
+ nbformat>=4.2.0
File without changes
File without changes