Questions tagged [pyjanitor]
7 questions
2
votes
2 answers
using regex in pivot_longer to unpivot multiple sets of columns with common grouping variable
Follow-up from my last question:
pyjanitor pivot_longer multiple sets of columns with common grouping variable and id column
In my last question, the dataset I gave was oversimplified for the problem I was having. I have changed the column names to…

prayner
- 393
- 1
- 10
1
vote
1 answer
pyjanitor pivot_longer multiple sets of columns with common grouping variable and id column
Follow-up from my last question:
regex column selection inside pd.melt function
I used the following code to pivot_longer columns that match the string "rating".
import pandas as pd
import janitor
(df
.pivot_longer(
column_names = "*rating",
…

prayner
- 393
- 1
- 10
1
vote
1 answer
pyjanitor conditional joins between date range based on columns
data:
Merging Pandas DataFrame within a specific Date Range
I want to use pyjanitor referring this post but it doesn't give if merge with another columns at the same time.
Try
df_1.conditional_join(
... df_2,
... ("InvoiceDate ",…

Jack
- 1,724
- 4
- 18
- 33
0
votes
1 answer
ModuleNotFoundError: No module named pyjanitor despite pyjanitor being installed
I've confirmed the pyjanitor package is installed - it shows up in pip list and I get a confirmation if I try to reinstall with pip install pyjanitor. But then when I run import pyjanitor I get the error:
No module named 'pyjanitor'
What am I…

Sam Firke
- 21,571
- 9
- 87
- 105
0
votes
1 answer
pyjanitor.pivot_longer: Unpivot multiple sets of columns with common prefix
Reprex csv:
col,ref_number_of_rows,ref_count,ref_unique,cur_number_of_rows,cur_count,ref_unique
region,2518,2518,42,212,212,12
country,2518,2518,6,212,212,2
year,2518,2518,15,212,212,15
I want to unpivot the dataset, where a typecolumn contains the…

prayner
- 393
- 1
- 10
0
votes
2 answers
import janitor as jn TypeError: 'type' object is not subscriptable
after sucessfully downloading the module
!pip install pyjanitor # works successfully
import janitor as jn # which worked just fine in the past, but suddenly throwing the following TypeError
TypeError: 'type' object is not subscriptable
I am…

onkaronkar4
- 43
- 7
0
votes
1 answer
Pythion: Conditional_join janitor package
Hi I want to do a lookup to get the factor value for my dataset based on 3 conditions. Below is the lookup table:
Lookup_Table = {'State_Cd': ['TX','TX','TX','TX','CA','CA','CA','CA'],
'Deductible': [0,0,1000,1000,0,0,1000,1000],
…

Bustergun
- 977
- 3
- 11
- 17