289,238 questions
0
votes
1
answer
21
views
pd.Timestamp has attribute .isoformat, but the series accessor .dt does not
I am trying to convert a column of pd.Timestamp objects into a columns of type str where the dates are encoded in ISO format.
The class pd.Timestamp has the handy classmethod .isoformat() that does ...
0
votes
0
answers
28
views
Bizzare "kernel has died" error in pandas df.to_excel() caused by geopandas
When pandas.read_excel(), df.to_excel(), geopandas.read_file() and gdf.to_file() are called in a certain order in different environments, pd.read_excel() sometimes causes "Kernel has died" ...
0
votes
1
answer
10
views
PintArray seems to be inaccessible. "AttributeError: module 'pint' has no attribute 'PintArray'."
I am fairly new to Python, and I must have missed something essential because I'm seeing broken functionality all over Pint. I'm starting to think it all comes down to PintArray is not available to ...
0
votes
1
answer
54
views
How to duplicate columns with a prefix/suffix when flattening a DataFrameGroupBy
I've been working on a project to learn python and play around with machine learning that uses data from the NHL's public API. I've been able to teach myself via documentation and google searches so ...
Tooling
1
vote
3
replies
49
views
Python delta time series conversion to time data type
I have a column named ride_length that is the difference between two datetime columns. It has a data type of time delta series. How can I convert it into a time data type?
Current format 1 day 12:58:...
1
vote
1
answer
61
views
How to find corrupted date entry when date column type is (object) [closed]
I am trying to convert a column of time stamps that are currently of type object to proper datetime. When using pd.to_datetime() on the column I got this error
OutOfBoundsDatetime: Out of bounds ...
5
votes
2
answers
106
views
Behavior of .groupby and .transform - length mismatch
I've been experimenting with pandas for my data analysis, however I encountered an issue when dealing with .groupby() and .transform() .
Let this be the dataframe:
df = pd.DataFrame({
'group': ['x'...
1
vote
3
answers
67
views
Conditionnal IF use not working with PD.NOTNA
Amateur programmer here, trying to make my working life bette.
I am building a billing program, using selenium webdriver, to facilitate people entering their information into the more complex web-...
-1
votes
1
answer
68
views
Pandas 'sep' Command Not Working for Text File [closed]
I have the following (shortened) list of data (State Vector for an arbitrary satellite):
0.0000000000000000e+00 6.0513311190355308e+06 -2.3889553726207524e-10 -3.9014601994371545e+06 4....
2
votes
4
answers
111
views
How can I handle missing values in a large pandas DataFrame without running out of memory?
I’m working with a large pandas DataFrame (~5 million rows, ~40 columns).
When I try operations like:
df = df.fillna(0)
# or
df = df.dropna()
my RAM usage spikes and sometimes my Jupyter notebook ...
2
votes
2
answers
73
views
Multiindexed Pandas Series to Yes/No table [duplicate]
I have a MultiIndex table as follows
Index0 Index1 Variable
A 0 "a"
A 1 "x"
A 2 "t"
B 0 "x"
B 1 ...
-1
votes
0
answers
59
views
Error when running the command python -m pip install -ve . --no-build-isolation --config-settings editable-verbose=true
When I run this command on the virtual environment it gives this error.
ninja: error: pandas/_libs/ops_dispatch.cp312-win_amd64.pyd.p/pandas/_libs/ops_dispatch.pyx.c.dep: no outputs declared
...
-1
votes
0
answers
38
views
Using Pandas as an ATE logger [closed]
I'm writing some automated electrical tests for a piece of equipment and am trying to figure out a good way to continuously display the data to the user.
The program will perform ~50 tests each with a ...
Best practices
1
vote
2
replies
59
views
How to merge pandas dataframes with MultiIndexes on the columns
I am trying to merge two pandas dataframes together that have a MultiIndex on the columns. This works as expected when there are no duplicate columns, however when there are duplicate columns, it ...
0
votes
0
answers
23
views
Forecasting : FB Prophet function doesn't start from last datapoint in python
I've noticed that Facebook's Prophet function does a good job with forecasting. However, for my data, it never starts at the last value of y-predict. As you can see in the image, the last value of ...