Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Trying to iterate over different teams in mean data from a larger dataset [duplicate]

Basically after the mean data for the teams home and away games is taken, I want to plot multiple graphs for each team in one loop, essentially, in the code below, where Arsenal is in quotes in the ...
Daragh's user avatar
  • 1
1 vote
3 answers
78 views

How do I transfer data from pandas Dataframe to a Dataframe variable of a different type

So I have a Dataframe of car data which has a price column. So I want to transfer the data from the price column a variable which is a Dataframe which has the same data as the original column, but I ...
200 OK's user avatar
  • 25
0 votes
1 answer
16 views

Prevent styler from adding timestamps to multiple date columns in pandas dataframe python

I have a pandas dataframe with six date columns with YYYY-MM-DD formatting and a datatype of datetime64[ns]. I want to apply a styler to the dataframe to freeze the column names when I do a vertical ...
swilson's user avatar
  • 55
1 vote
1 answer
60 views

How do I count blank an filled cells in each column in a .csv file?

What I want is to count the filled and blank cells in each column of a .csv file. This is my code: import pandas as pd file_path = r"C:\Users\andre\OneDrive\Documentos\Farmácia\Python\...
André's user avatar
  • 21
0 votes
0 answers
33 views

URL journey map chart (Customer Journey Map, CJM)

I have this dataframe: client_id date_time url steps 0 506 2024-08-20 05:00:00 google.com/page_1 step_1 1 506 2024-08-20 05:01:00 google.com/page_2 step_2 2 506 2024-08-20 05:04:00 ...
Stepan Potapov's user avatar
1 vote
1 answer
71 views

Pandas 'rename'-function not working within jupyter notebook?

I have a pandas dataframe ('df3') which columns I would like to rename.It is a subset of another dataframe, and I'm working in a jupyter notebook. Getting all infos from the dataframe structure: df3....
i.i.k.'s user avatar
  • 207
-1 votes
1 answer
209 views

How to filter array in Pandas dataframe? [duplicate]

Is it possible to filter array without creating new columns? For example i have this dataframe: userID goalsID 25 [1,2,4,5] 188 [3,6] 79 [1,9] How to filter array by digit &...
Stepan Potapov's user avatar
0 votes
2 answers
70 views

How to present a sparse matrix of differences between two Python dataframe objects?

For auditing purposes, we want to compare two objects of Python dataframe in Jupyter Notebook, and they contain the before and later versions of the same data set. If we call the .compare() function ...
Mike's user avatar
  • 55
0 votes
2 answers
61 views

I converted my .ipynb file into a .py script but when I run it, it does not work. (VS Code)

What i'm trying to do in this notebook is reading the file "updated_coffee_sales_data.xls" with Pandas, cleaning the file, and then exporting it into another excel file. This work with ...
Mr Jxtr's user avatar
  • 120
0 votes
0 answers
61 views

Voila output to html - can't see output file

This is a simple query about the useful voila module in python I've got a jupyter notebook called voila_testing.ipynb - although it could be any notebook. It is hosted on Sharepoint and all I want to ...
elksie5000's user avatar
  • 7,722
0 votes
0 answers
43 views

text_auto Parameter Not Working in Plotly

The text_auto parameter for a Plotly Express bar chart is not functioning for me, despite seemingly correct syntax. I am using both Jupyter Notebook and Eclipse and the issue persists in both. Plotly ...
Lysyd's user avatar
  • 1
2 votes
1 answer
49 views

Is There a Way to Expose a Plot Generated Using a Pandas Dataframe as a Jupyter Notebook as an App to the End User?

Current Workflow Right now, me, as an ML engineer, am using a jupyter notebook to plot some pandas dataframes. Basically, inside the jupyter notebook, I am setting some hard-coded configurations like ...
Della's user avatar
  • 1,602
0 votes
2 answers
112 views

How to use a specific version of methylprep in Jupyter notebook

I am trying to use a package named Methylprep. It is using "append" function for dataframe, which has been removed since pandas 2.0. Now the version of pandas installed in my pc is 2.2.2. ...
Isaac P. Liu's user avatar
0 votes
0 answers
33 views

FileNotFoundError when trying to load a CSV file into pandas in Jupyter Notebook [duplicate]

I have been attempting to read data from a CSV file using a Python script in Jupyter Notebook. I expected the script to successfully load the CSV data into a pandas DataFrame without errors, however, ...
Wangui's user avatar
  • 1
0 votes
0 answers
28 views

combine several rows into one using Pandas [duplicate]

I have a dataset of lab results from patients on different dates. I want to combine each patient's results into a single row. The types and number of lab results are unlimited. I tried to simplify my ...
sepme's user avatar
  • 51
1 vote
0 answers
315 views

Python (Jupyter) Notebook in browser: no horizontal scrollbar at the bottom of a cell?

I use python notebook (browser) often. There's a vertical scrollbar on a cell, but no horizontal scrollbar to allow me to access columns on the right side of a cell: The only way I found to see ...
Xhattam's user avatar
  • 307
0 votes
1 answer
116 views

Why does df.means() cause "Javascript Error: too much recursion" in Jupyter?

I am doing some ML-Training on the pump_sensor_data from Kaggle:https://www.kaggle.com/datasets/nphantawee/pump-sensor-data (Instructions for Analysis of the Data for Reference: https://www.kaggle.com/...
DrNuke's user avatar
  • 11
0 votes
1 answer
55 views

Is there a parameter problem, or not working with this method?

I wanted to predict the disease type using a function with a given string parameter. The parameter can contain more than one string. But it always gives an error message: KeyError: 'skin_rash' This is ...
crm revesz's user avatar
0 votes
1 answer
68 views

Pandas: Limiting __repr__ and _repr_html_ behaviour with Xarray

I am storing large xarrays in my dataframe, but any time I display the dataframe in Jupyter or the terminal it takes way to long (11 seconds for a 10 row dataframe). I'd imagine it has something to do ...
Gibson Strickland's user avatar
0 votes
0 answers
51 views

How to use items from a DataFrame as a dropdown in ipywidgets

I have imported ipywidgets in Jupyter Notebooks. I have created a dropdown widget, but I am trying to use items in a column as the dropdown list options. input_perfume = 'Sola Parfum' recommendations =...
user24839487's user avatar
0 votes
0 answers
81 views

Getting daily OHLC prices from hourly data at specific times

In this example I have a dataframe filled with OHLC hourly data from EURUSD. My strategy revolves around signaling daily patterns and executing on the hourly timeframe. Therefore, besides hourly OHLC ...
Koen Graveland's user avatar
2 votes
3 answers
113 views

Calculating an ongoing win streak in a dataframe

I have a set of data for sport matches which is in a form like this: winner = ['A', 'A', 'B', 'C', 'A', 'C', 'C', 'B'] loser = ['B', 'C', 'A', 'A', 'B', 'A', 'B', 'C'] P1 = ['A', 'A', 'A', 'A', '...
Lavacave's user avatar
0 votes
1 answer
584 views

Read_csv() in Pandas doesn't recognize one of its arguments: date_format

I have a Jupyter notebook that has worked in the past. Recently however (without upgrading anything) I have run into this problem: read_csv() got an unexpected keyword argument 'date_format' The cell ...
Kajmunso's user avatar
3 votes
0 answers
311 views

Pandas display() nice table in AWS Glue Jupyter Notebook

In AWS Glue Jupyter Notebook, I wanted to display() the dataframe in Pandas nice table (HTML) but it only shows the raw text. Example: In AWS Glue Jupyter Notebook, it only shows the raw text: ...
Chong Onn Keat's user avatar
0 votes
1 answer
74 views

How to get entries with specific values in jupyter notebook/ python?

I have a dataframe containing some age group and health status. When I dropped entries not containing "RECOVERED" in "HealthStatus", the output is a table containing only the ...
JCO's user avatar
  • 1
-1 votes
1 answer
55 views

Plane bestfit only gives parabola over scatterplot?

I have plotted a bunch of data as a scatter plot on 3 axes. I used one way and got a parabola shape, which wasn't what I wanted, but the example given shows a distinct plane shape. I guess I am ...
user2499554's user avatar
0 votes
1 answer
49 views

How to include colspan to a table header while web scraping

I am new to web scraping, I am trying to web scrape this website the 2022 Forbes Table - https://en.wikipedia.org/wiki/List_of_largest_companies_in_India , but the Rank column and the Forbes Rank ...
Yuvraj Sood's user avatar
1 vote
0 answers
113 views

Mercury + Mito + jupyter notebook

I built a web application via Mercury, which run some script and show tables. But now I need to implement opportunity to edit those tables inside the web app. I tried a Mito package import mitosheet ...
Avigail Shnaider's user avatar
2 votes
1 answer
2k views

Jupyter Notebook javascript error when trying to display the widgets

I am currently working on a EDA Project using ydata_profiling library. This is the code i have written as of now: import numpy as np import pandas as pd from ydata_profiling import ProfileReport ...
Mansi Upadhyay's user avatar
0 votes
0 answers
52 views

Error: 'NoneType' object has no attribute 'index" after loop runs a few times

def animate(i): global firstTime global btc_hourly tv = TvDatafeed() if (firstTime): btc_hourly = tv.get_hist(symbol='BTCUSD',exchange='BITSTAMP',interval=Interval....
Revealed's user avatar
0 votes
0 answers
65 views

Unable to deploy my Jupyter Notebook to Medium as a post

I am trying to publish a Jupyter Notebook as a medium blog, I installed all the necessary libraries, then I put in my integration token too, and every other detail, including the correct file path ...
Olumide Olaoye's user avatar
-3 votes
4 answers
892 views

ModuleNotFoundError: No module named 'pandas' ( on Mac OS )

I get this error when importing pandas in jupyter notebook. But I've install Pandas with the brew command and it was successful. I also installed Pandas with the pipx command of the terminal, but I ...
Persian Developer's user avatar
-1 votes
1 answer
42 views

Data analysis: problem with mapping and correcting typos in column

I've been reviewing data for a project on jupyter and I was hoping to map some data to fit it in a specific category of company. In the end, I used a big if loop but the problem as expected is I cant ...
Florian's user avatar
-3 votes
2 answers
38 views

I'm going to analyzing the data using python for get prediction [closed]

from sklearn.model_selection import train_test_split This gave me below error At line:1 char:1 + from sklearn.model_selection import train_test_split + ~~~~ The 'from' keyword is not supported in ...
Piyumi Nadeesha's user avatar
0 votes
1 answer
57 views

Returning predictions when comparing data frames

I have the following two data frames: df1 = { 'file_names': ['file_name1', 'file_name2', 'file_name3', 'file_name4'], 'class1': [0.655, 0.5216, 0.1561, 0.5616], 'class2': [0.5216, 0.0231, ...
euler614's user avatar
1 vote
1 answer
55 views

Pandas MultiIndex not returning levels and labels

I am learning about pandas MultiIndex() for the first time. Here I have two lists that I want to combine using the MultiIndex() function. the outcome I am expecting should have levels and labels but ...
Noha's user avatar
  • 23
0 votes
1 answer
186 views

How can I apply a code to a zip file while also changing the filetype in the output zip folder?

I have a code that I am trying to use on a zip file in python and I want the output to be another zip file, but with the files changed to .txt or .csv. The code I have runs without error, but fails to ...
uranis's user avatar
  • 15
0 votes
0 answers
28 views

Whitespace delimiter sep='\s+' not effectively working in Jupyter Notebook with pandas [duplicate]

I ended up solving this right after I finished to question. Reviewed Documentation for pandas.read_csv delim_whitespace : boolean, default False Specifies whether or not whitespace (e.g. ' ' or ' '...
No Time's user avatar
  • 101
3 votes
0 answers
307 views

Is it possible to turn Mathjax off in Pandas and/or Jypyter Notebook?

It has already been discussed here that Mathjax interprets dollar sign $ as start of its code. String within Pandas dataframes when rendered in Jupyter Notebook get garbled if they contain a dollar ...
DataBunny's user avatar
  • 185
1 vote
0 answers
68 views

plt.plot not plotting on correct x axis points [duplicate]

My code: plt.figure(figsdize = (20,10)) # plot close price, short-term and long-term moving averages df['close'].plot(color = 'k', label= 'Close Price') df['sma_20'].plot(color = 'b',label = '20-day ...
indianapolis.jones's user avatar
0 votes
0 answers
77 views

How to convert all rows in JupyterLab with '%sql'?

I am so confused and need your help. I work in a company, and I also use company's JupyterLab servers and resources. Today I connect company's database, then I want to convert all the query results of ...
zjh1001's user avatar
  • 29
0 votes
1 answer
243 views

Parenthesis in negative numbers on Pandas Styler object

So I got a 3x3 dataframe that looks like this: import pandas as pd df = pd.DataFrame([[-232.3,43.1,"hre"],[-245.7,-943.7,"jtr"],[956.3,435.2,"fgjh"]], columns=list("...
Purple's user avatar
  • 3
0 votes
2 answers
91 views

reset running count based on 1's and 0's of column

data = pd.DataFrame( {"categ": [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1], "value": [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1], &...
aaaahhhhhh's user avatar
2 votes
1 answer
3k views

reset_index acting in an unexpected way - unexpected keyword argument 'names'

I'm cleaning up a dataset for plotting. Pretty standard stuff, transposing, deleting unnecessary columns, etc. Here is the code so far: #File name fname = r'E:\Grad School\Research\BOEM\Data\Grain ...
Liraell's user avatar
  • 75
0 votes
0 answers
30 views

I have a problem with Jupyter notebook. I'm getting errors in my computer, but in another the error doesn't happen

I'm using windows 11 in my computer and in the computer of work. In my personal computer i try to run a code and a error appears, but I try the same code, same files in the computer of work and the ...
user avatar
1 vote
1 answer
37 views

The truth value of a Series is ambiguous error in dataframe pandas

I currently have lots of 1000s in a column of my dataframe, I would like to change the value of this 1000 into a different number depending on whether the year given is before 2000 or after 2000 this ...
Beginner_coder's user avatar
0 votes
1 answer
107 views

How to build a new field with an if condition in Python through Jupyter Notebook

I am trying to create a field that will assign values based on if column a = column b, column c (The new field) will equal no, if not, then yes. Exactly same as an excel formula =IF(A2=B2,"No&...
JT112's user avatar
  • 1
0 votes
2 answers
66 views

Pandas: Find the highest probability of keywords in text column

I have the following list of keywords. I want to find the highest probability of keywords in each rows of the column. Probability will be calculated like this: Probability(keyword class) = total no. ...
hxgx_0990's user avatar
1 vote
1 answer
42 views

Joining 2 separate excel based 1 condition with python

I have these two frames df1 birthdate ceremony_number 9/30/1895 1st 7/23/1884 1st 3/29/1889 2nd 4/10/1868 3rd 4/8/1892 2nd df2 index dates 1 1929-05-16 2 1930-04-03 3 1930-11-05 I thing is ...
victor_sanger's user avatar

1
2 3 4 5
44