Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

pandas

Keep other columns when doing groupby

August 20, 2022 by Magenaut

I’m using groupby on a pandas dataframe to drop all rows that don’t have the minimum of a specific column. Something like this:

Categories Python, Q&A Tags aggregate, pandas, pandas-groupby, python Leave a comment

Pandas fillna using groupby

August 20, 2022 by Magenaut

I am trying to impute/fill values using rows with similar columns’ values.

Categories Python, Q&A Tags pandas, python Leave a comment

How to replace text in a string column of a Pandas dataframe?

August 20, 2022 by Magenaut

I have a column in my dataframe like this:

Categories Python, Q&A Tags dataframe, pandas, python, replace Leave a comment

Pandas split DataFrame by column value

August 20, 2022 by Magenaut

I have DataFrame with column Sales.

Categories Python, Q&A Tags dataframe, indexing, pandas, python, split Leave a comment

Combine two pandas Data Frames (join on a common column)

August 20, 2022 by Magenaut

I have 2 dataframes:

Categories Python, Q&A Tags dataframe, left-join, merge, pandas, python Leave a comment

Combine Date and Time columns using python pandas

August 20, 2022 by Magenaut

I have a pandas dataframe with the following columns:

Categories Python, Q&A Tags datetime, pandas, python, time-series Leave a comment

How to one-hot-encode from a pandas column containing a list?

August 20, 2022 by Magenaut

I would like to break down a pandas column consisting of a list of elements into as many columns as there are unique elements i.e. one-hot-encode them (with value 1 representing a given element existing in a row and 0 in the case of absence).

Categories Python, Q&A Tags numpy, pandas, python, scikit-learn, sklearn-pandas Leave a comment

Performance of Pandas apply vs np.vectorize to create new column from existing columns

August 20, 2022 by Magenaut

I am using Pandas dataframes and want to create a new column as a function of existing columns. I have not seen a good discussion of the speed difference between df.apply() and np.vectorize(), so I thought I would ask here.

Categories Python, Q&A Tags arrays, numpy, pandas, performance, python Leave a comment

How to convert string to datetime format in pandas python?

August 20, 2022 by Magenaut

I have a column I_DATE of type string(object) in a dataframe called train as show below.

Categories Python, Q&A Tags datetime, pandas, python Leave a comment

How do I get a list of all the duplicate items using pandas in python?

August 20, 2022 by Magenaut

I have a list of items that likely has some export issues. I would like to get a list of the duplicate items so I can manually compare them. When I try to use pandas duplicated method, it only returns the first duplicate. Is there a a way to get all of the duplicates and not just the first one?

Categories Python, Q&A Tags duplicates, pandas, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page26 Page27 Page28 … Page92 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress