Skip to content

Magenaut

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

pandas

How to convert an XML file to nice pandas dataframe?

August 21, 2022 by Magenaut

Let’s assume that I have an XML like this:

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

How to save a new sheet in an existing excel file, using Pandas?

August 21, 2022 by Magenaut

I want to use excel files to store data elaborated with python. My problem is that I can’t add sheets to an existing excel file. Here I suggest a sample code to work with in order to reach this issue

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

How to display pandas DataFrame of floats using a format string for columns?

August 21, 2022 by Magenaut

I would like to display a pandas dataframe with a given format using print() and the IPython display(). For example:

Categories Python, Q&A Tags dataframe, ipython, pandas, python, python-2.7 Leave a comment

Fast punctuation removal with pandas

August 20, 2022 by Magenaut

This is a self-answered post. Below I outline a common problem in the NLP domain and propose a few performant methods to solve it.

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

Replace values in a pandas series via dictionary efficiently

August 20, 2022 by Magenaut

How to replace values in a Pandas series s via a dictionary d has been asked and re-asked many times.

Categories Python, Q&A Tags dictionary, pandas, performance, python, python-3.x Leave a comment

Pandas read_csv low_memory and dtype options

August 20, 2022 by Magenaut

When calling

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

How to pivot a dataframe in Pandas?

August 20, 2022 by Magenaut

I have a table in csv format that looks like this. I would like to transpose the table so that the values in the indicator name column are the new columns, Indicator Country Year Value 1 Angola 2005 6 2 Angola 2005 13 3 Angola 2005 10 4 Angola 2005 11 5 Angola 2005 5 … Read more

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

Convert pandas timezone-aware DateTimeIndex to naive timestamp, but in certain timezone

August 20, 2022 by Magenaut

You can use the function tz_localize to make a Timestamp or DateTimeIndex timezone aware, but how can you do the opposite: how can you convert a timezone aware Timestamp to a naive one, while preserving its timezone?

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

Format / Suppress Scientific Notation from Pandas Aggregation Results

August 20, 2022 by Magenaut

How can one modify the format for the output from a groupby operation in pandas that produces scientific notation for very large numbers?

Categories Python, Q&A Tags floating-point, number-formatting, pandas, python, scientific-notation Leave a comment

Find row where values for column is maximal in a pandas DataFrame

August 20, 2022 by Magenaut

How can I find the row for which the value of a specific column is maximal?

Categories Python, Q&A Tags argmax, dataframe, pandas, python, row Leave a comment
Older posts
Newer posts
← Previous Page1 … Page19 Page20 Page21 … 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