289,230 questions
1
vote
2
answers
46
views
How to delete one single element in a DataFrame
Would like to delete one single element from a Python DataFrame, as in:
a x b c
1 2 3
becomes
a b c
1 2 3
All the solutions I have seen seem to require copies and creating a new DataFrame, which ...
1
vote
3
answers
61
views
Access data frame from binary file
if I have saved a data frame using pickle in a binary file how can I access it?
def create_dataset(path):
"""
creates an binary file with dataset saved in it.
"&...
-3
votes
2
answers
53
views
How to print the value counts of a user-selected column in a pandas DataFrame? [closed]
I’m trying to write a Python script that allows the user to input the name of a column and then prints the value counts of that column from a pandas DataFrame. Here's what I currently have:
def ...
0
votes
1
answer
25
views
When big data : requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
The problem appears when i have a big amount of values in my pandas df. When i take 27 or 54 values(1 or 2 columns) it works normaly, but when i take more columns it gives me this erorr (i import gs ...
-4
votes
0
answers
61
views
need help for Data Cleaning and Preprocessing in my project [closed]
import pandas as pd
import numpy as np
import seaborn as sns
df=pd.read_excel('Online_Retail.xlsx')
#Alternative Method to Introduce Missing Values: Using numpy.random.rand
# Make a copy of the ...
3
votes
2
answers
65
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 ...
1
vote
1
answer
62
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
20
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 ...
Advice
0
votes
4
replies
67
views
Shifting string values to a previous column in a dataframe
Here is what i have in a dataframe where a column has names and some numbers together since this is a table extracted from a PDF
0 1 2 3 4
Mr. A ...
1
vote
1
answer
71
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
51
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
64
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
119
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
71
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
70
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....