[Python] I'm getting a conversation error after running .hist() method , does anyone know if...

Discussão em 'Python' iniciado por Stack, Maio 12, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to run the following line of code in python df1['A'].hist() , but i keep getting this long error on conversion (see bottom)

    import numpy as np import pandas as pd %matplotlib inline import matplotlib.pyplot as plt

    df1 = pd.read_csv('df1',index_col=0) df1.head()

    index ,A B C D 2000-01-01 1.339091 -0.163643 -0.646443 1.041233 2000-01-02 -0.774984 0.137034 -0.882716 -2.253382 2000-01-03 -0.921037 -0.482943 -0.417100 0.478638 2000-01-04 -1.738808 -0.072973 0.056517 0.015085 2000-01-05 -0.905980 1.778576 0.381918 0.291436

    Here's the error:

    <Axes: title={'center': 'D'}> Error in callback <function _draw_all_if_interactive at 0x000002AD65F12FC0> (for post_execute), with arguments args (),kwargs {}:


    ValueError Traceback (most recent call last) File ~\anaconda3\Lib\site-packages\matplotlib\axis.py:1813, in Axis.convert_units(self, x) 1812 try: -> 1813 ret = self.converter.convert(x, self.units, self) 1814 except Exception as e:

    Continue reading...

Compartilhe esta Página