CARVIEW |
Select Language
HTTP/2 200
date: Thu, 17 Jul 2025 21:02:05 GMT
content-type: text/html; charset=utf-8
cf-ray: 960cad9eb9fcc177-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=85cd1d5b-22cd-49f9-b70f-f01a7b0f9a03; expires=Fri, 17 Jul 2026 21:02:04 GMT; domain=.stackoverflow.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
feature-policy: microphone 'none'; speaker 'none'
x-frame-options: SAMEORIGIN
x-request-guid: 2fe2eaba-ab41-4c6a-9a1b-3a2d16a2baae
x-worker-origin-response-time: 756000000
x-dns-prefetch-control: off
set-cookie: __cflb=02DiuFA7zZL3enAQJD3AX8ZzvyzLcaG7vcs6kiGFUpDBA; SameSite=Lax; path=/; expires=Fri, 18-Jul-25 20:02:05 GMT; HttpOnly
set-cookie: prov=85cd1d5b-22cd-49f9-b70f-f01a7b0f9a03; Path=/; HttpOnly; Domain=stackoverflow.com
set-cookie: __cf_bm=a8Qw1OjJ95LGrsy8XSPeqXQ7T44Ay8DcRagR5XiRWug-1752786125-1.0.1.1-oOeO9nt_BZNCmXcW92A2XArPMpOlw61EkEbEkh3H3FuscRppc9SDwstUsd5SmZufgl0hptTj3PL0z103gySegUXh9GUcP3yNPNSichRBdKY; path=/; expires=Thu, 17-Jul-25 21:32:05 GMT; domain=.stackoverflow.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=e3mpOc0mjJCnkORRzUlkxYfe0GSyt91PINP2McZTIsQ-1752786125366-0.0.1.1-604800000; path=/; domain=.stackoverflow.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'pandas' Questions - Stack Overflow
Skip to main content
Stack Overflow
- Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
- Advertising Reach devs & technologists worldwide about your product, service or employer brand
- Knowledge Solutions Data licensing offering for businesses to build and improve AI tools and models
- Labs The future of collective knowledge sharing
- About the company Visit the blog
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
289,262 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
49
views
pandas test if the datatype of an input series supports nan values
I had something like the following code using pandas 1.x that new generates a warning in pandas 2:
import pandas as pd
import numpy as np
df1 = pd.DataFrame({"i":[1,2,3,4,5], "a":[...
0
votes
0
answers
68
views
Python merge multiple dataframes out of memory and chunk them while preserving multindex boundaries
Say I have a multindex dataframe with index lev1,lev2,lev3 that is created by merging 3 datasets with indexes [lev1], [lev1,lev2] and [lev1,lev2,lev3]. Each dataframe is a subset of the other (all ...
0
votes
0
answers
51
views
Best way to convert FastAPI/SQLmodel into Polars Dataframe?
What is best way to convert a FastAPI query into a Polars (or pandas) dataframe.
Co-pilot give this.
with Session(engine) as session:
questions = session.exec(select(Questions)).all()
...
0
votes
1
answer
81
views
Polars.write_excel: How to remove thousand separator for i64 & f64 and remove trailing zero for f64 efficiently?
SOLUTION as of 16JUL25:
See rotabor's float_precision answer for trailing zero problem.
To solve thousands separator problem gracefully without unnecessary steps, do NOT bother using polars....
0
votes
0
answers
42
views
Reading parquet files with pandas [closed]
I am trying to read my saved parquet files on Jupyter notebook using pandas
df = pd.read_parqet()
but it's unable to execute that line and after a few minutes it says
-The Kernel for the file__ seemed ...
2
votes
1
answer
76
views
2
votes
1
answer
45
views
How to identify price regimes / trends in Pandas
I have created the following pandas dataframe, which is an example of 26 stock prices (Open, High, Low, Close):
import pandas as pd
import numpy as np
ds = {
'Date' : ['15/06/2025','16/06/2025','17/...
2
votes
1
answer
48
views
Indicating which column wins in a df.min() call [duplicate]
I want to find the minimum value per row and create a new column indicating which of those columns has the lowest number. Unfortunately, it seems like pandas isn't immediately able to help in this ...
0
votes
0
answers
68
views
How to do pandas grouping, filtering, and a pie chart using chained operations? [closed]
How can I simplify the code below and make it more efficient using chained operations? Currently, I am creating intermediate objects and using a for loop.
I use this data: https://www.kaggle.com/...
0
votes
3
answers
128
views
How can I remove the brackets and parentheses at the end of words? [closed]
My task is to parse the protein names by removing the brackets and parentheses in the row.
In short, I want to retain the words in front of any parentheses and brackets.
Note that I need to keep ...
1
vote
1
answer
79
views
fill row value based on column identifier
I have a dataframe like below, and would like to fill value from previous row value based on id field, so, any record with 4 in colA get what the previous colA=3 records' colC value, colB stays the ...
0
votes
1
answer
54
views
Pandas Pivot_table KeyError when Key is Present
I've run this code in an older version of Python, with success; however, we've recently switched to Python 3.9 and I'm getting a KeyError:'RegIndex' on a pivot step for a column that exists in the ...
2
votes
1
answer
70
views
Pandas dataframe, resample for individual values in my column
I have a pandas dataframe that looks like this:
Date Country Value
0 2021-10-22 GB 98.139514
1 2021-11-29 GB 103.875788
2 2021-12-29 GB 111.097210
3 ...
-2
votes
0
answers
43
views
how to find the top N or bottom N numeric values of a DF after a group by [duplicate]
This prints out the 10 worst mean values in a dataframe (this dataframe was constructed with an agg, so it has a multi-level column name).
worst = rcresult.sort_values(by=('resolvetime', 'mean'), ...
1
vote
1
answer
55
views
Tried plotting yfinance data by framing into pandas with the help of seaborn and matplotlib. Shows error no matter what. How to fix this?
import yfinance as yf
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
df = yf.download('AAPL',start="2021-01-01",end='2025-07-13')
print(df.head()) #display the ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
Related Tags
python × 249851
dataframe × 90739
python-3.x × 31287
numpy × 21350
matplotlib × 11627
csv × 11024
datetime × 8957
pandas-groupby × 7991
excel × 5837
group-by × 5649
dictionary × 4826
json × 4264
list × 4252
python-2.7 × 4183
merge × 3720
scikit-learn × 3432
string × 3363
time-series × 3165
seaborn × 3145
regex × 2842
jupyter-notebook × 2834
loops × 2833
indexing × 2820
data-science × 2726
multi-index × 2564
more related tags
Hot Network Questions
- Can someone feel happy (or feel any other emotion, for that matter) without being aware of it?
- How would double jeopardy apply in the P. Diddy case?
- Parsing HTTP headers in C
- Why didn't the Democrats release the Epstein files while Biden was president?
- How to determine the dispersion of a model using the DHARMa package in R
- Is "3.5e" the official name/nomenclature for the edition?
- Why does positive mean descriptive
- Builder pattern in Rust
- Table split into two parts but not vertically aligned
- Who was leading the race?
- Can someone explain to me how a formula for the sine function is derived?
- In The Bourne Identity, why did Marie stay with Jason?
- Example of a finite-dimensional Lie algebra with a fixed-point-free automorphism of prime power order which is not nilpotent
- Gödel's reception and reaction to Cohen's forcing and his proof of the independence of CH?
- Question about voices in Satie’s Gymnopédie No. 1
- when pedaling backwards chain falls
- LT8361 generate -80 voltage
- Should I omit bad papers from my CV that I didn't want to write?
- Can you unlink linked Scenes? And how to know which of two Scenes are fully copied or linked?
- You mean, I can't just put my space-filling curve anywhere I want??
- Why don't Research Universities offer Tenure(-track) Teaching Positions
- Auto/Cross-correlation of a sinusoidal signal
- Which version of Wind in the Willows did I see in the 1990s?
- EMTs inventing screw fittings for space suits