Python Forum
AttributeError: 'numpy.int32' object has no attribute 'split' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: AttributeError: 'numpy.int32' object has no attribute 'split' (/thread-37534.html)



AttributeError: 'numpy.int32' object has no attribute 'split' - rf_kartal - Jun-23-2022

Hi everyone,

I get the error "AttributeError: 'numpy.int32' object has no attribute 'split'" in all codes that contain UTCDateTime functions I use. What does it mean? How can solve this problem?

Thank you.


RE: AttributeError: 'numpy.int32' object has no attribute 'split' - Anushka00 - Jun-23-2022

Hi! As per the error description, given by you, an integer cannot be split until it is converted to a string.
however, you can post the code snippet where you encounter the error for further doubt clearance.


RE: AttributeError: 'numpy.int32' object has no attribute 'split' - rf_kartal - Jun-23-2022

(Jun-23-2022, 11:22 AM)Anushka00 Wrote: Hi! As per the error description, given by you, an integer cannot be split until it is converted to a string.
however, you can post the code snippet where you encounter the error for further doubt clearance.

from obspy.io.xseed import Parser
from obspy.signal import PPSD
from obspy.clients.fdsn import Client
from obspy import UTCDateTime
from obspy.imaging.cm import pqlx
import warnings
warnings.filterwarnings('ignore')

net = 'TU'
sta = 'BIRL'
loc = '*'
chan = '*HZ'
time = UTCDateTime(2022, 5, 23, 20, 00, 00)
wf_starttime = UTCDateTime(2022, 5, 20, 00, 00, 00)
wf_endtime = UTCDateTime(2022, 5, 23, 00, 00, 00)



RE: AttributeError: 'numpy.int32' object has no attribute 'split' - rf_kartal - Jun-23-2022

Hi,
I using PyCharm editor for python code write.
When I write
from obspy import UTCDateTime
in Python Console, I receive error message as below:
AttributeError: 'numpy.int32' object has no attribute 'split'


RE: AttributeError: 'numpy.int32' object has no attribute 'split' - Anushka00 - Jun-24-2022

Hi! it must be some other line of code that is raising the error. The given code snippet runs absolutely fine.


RE: AttributeError: 'numpy.int32' object has no attribute 'split' - rf_kartal - Jun-24-2022

(Jun-24-2022, 07:32 AM)Anushka00 Wrote: Hi! it must be some other line of code that is raising the error. The given code snippet runs absolutely fine.

Hi,
Yes, you are right. Because the problem is not related to code. The problem is related to obspy library. when I write
from obspy import UTCDateTime
in Python Console, I receive same error message. There for I removed obspy library and reinstall. The problem is solved.
Thank you for your interest.


RE: AttributeError: 'numpy.int32' object has no attribute 'split' - Anushka00 - Jun-24-2022

Glad you could resolve the error!