dukit 0.3.0__tar.gz → 0.3.1__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.4
2
2
  Name: dukit
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: dukit - data utilities kit for exploring, modifying and visualizing small but messy data using pandas
5
5
  Keywords: pandas,query,utility,data,diff
6
6
  Author: MartinVoelkl94
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dukit"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "dukit - data utilities kit for exploring, modifying and visualizing small but messy data using pandas"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dukit"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "dukit - data utilities kit for exploring, modifying and visualizing small but messy data using pandas"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "MartinVoelkl94", email = "martinv16248@gmail.com" }]
@@ -577,19 +577,20 @@ def stack(
577
577
  _stack_check_successfull_match(not_matched, verbosity)
578
578
 
579
579
  for subid_val in subdfs.keys():
580
- subdf = subdfs[subid_val]
581
580
  if dropna:
582
- subdf = subdf.dropna(how='all')
581
+ subdfs[subid_val] = subdfs[subid_val].dropna(how='all')
583
582
  uid_vals = [
584
583
  uid_template.format(uid=uid_old, subid=subid_val)
585
- for uid_old in subdf.index
584
+ for uid_old in subdfs[subid_val].index
586
585
  ]
587
- subdf.insert(0, uid, uid_vals)
586
+ subdfs[subid_val].insert(0, uid, uid_vals)
588
587
 
588
+ df_keep = df[cols_keep].reset_index()
589
589
  df_new = pd.concat(list(subdfs.values()), axis='index')
590
+ df_new = df_new.reset_index()
590
591
  df_new = pd.merge(
591
- df[cols_keep].reset_index(),
592
- df_new.reset_index(),
592
+ df_keep,
593
+ df_new,
593
594
  on=uid_old,
594
595
  how='right',
595
596
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes