- Posts: 2
Getting 'ValueError'
- Vish234
- Topic Author
Less
More
17 Aug 2023 04:56 #12428
by Vish234
Getting 'ValueError' was created by Vish234
Input contains NaN, infinity or a value too large for dtype('float64')' when trying to perform a groupby operation on my DataFrame. Here's my code snippet:
I've checked for NaN or infinity values in 'value' column using
and
which both returned 0. What could be causing this error and how can I resolve it?
Code:
import pandas as pd
# Load data from CSV
data = pd.read_csv('data.csv')
# Perform groupby operation
grouped = data.groupby('category')['value'].sum()
I've checked for NaN or infinity values in 'value' column using
Code:
data['value'].isnull().sum()
Code:
data['value'].isinf().sum()
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
17 Aug 2023 17:40 - 17 Aug 2023 17:40 #12436
by pgilman
Replied by pgilman on topic Getting 'ValueError'
Hi Vishal,
I think this is a general Python question rather than one about PySAM. If it is about PySAM, please describe the PySAM context if you would like to help me troubleshoot. For example, perhaps the 'data.csv' file contains data generated by PySAM -- if it does, it would be helpful to have a copy of the file.
Best regards,
Paul.
I think this is a general Python question rather than one about PySAM. If it is about PySAM, please describe the PySAM context if you would like to help me troubleshoot. For example, perhaps the 'data.csv' file contains data generated by PySAM -- if it does, it would be helpful to have a copy of the file.
Best regards,
Paul.
Last edit: 17 Aug 2023 17:40 by pgilman.
Please Log in or Create an account to join the conversation.
Moderators: pgilman