Skip to content

Tag: python

Change structure of dictionary in Python Pandas

Is there a way of changing structure of nested dictionary? I have a column in dataframe with many rows of dictionaries, which looks like that: Is there a way of modifying structure, so that it will looks like without changing actual values? Answer You should read about the function apply() in pandas. You buil…

discord.py’s on_member_leave event isn’t working

Making a bot that logs basic events, like on_member_join and on_message has been working, but when I implemented the on_member_leave, that event hasn’t been working. I have previously turned on intents. I’ve tried adding, It still hasn’t been working, what am I doing wrong, what are some thi…

Scaler fitted in a pipeline turns out to be not fitted yet

Please consider this code: I get this message: Why is the scaler not fitted? Answer When passing a pipeline or an estimator to RFE, it essentially gets cloned by the RFE and fit until it finds the best fit with the reduced number of features. To access this fit estimator you can use fit_pipeline = rfe.estimat…