pandas

How can i import data from kaggle while not downloading it?

How can i import data from kaggle while not downloading it? Question: I want to import data from kaggle to my Notebook while not having to download it (So if i share my .ipynb u only need to run the code and it will download it from the internet), but i can’t figure out if …

Total answers: 1

How to fusion cells of a dataframe by summation

How to fusion cells of a dataframe by summation Question: I want to transform my dataframe by merging it cells and summing them into other larger cells given the indices of those, as an example, given the indices [0,2] & [2,4] on the X and Y axis and go from the following dataframe : +—-+—-+—-+—-+ …

Total answers: 3

Pandas percentage change matrix

Pandas percentage change matrix Question: I have a data frame: product cost 0 product a 56 1 product b 59 2 product c 104 I’d like to make a percentage change matrix like: product a product b product c product a -5.08% -46.15% product b 5.36% -43.30% product c 85.71% 76.27% There could be n …

Total answers: 4

Pandas to_excel formatting float values

Pandas to_excel formatting float values Question: I’m exporting a dataframe to an excel file using to_excel from pandas but I need that all the number values (float64) to be formatted (without specifing each columns because that will be variable) as a string (BRL currency) when exported. import pandas as pd df = pd.DataFrame({‘Numero’: {0: ‘044121’, …

Total answers: 3

Conditional merging with pandas

Conditional merging with pandas Question: I have a pandas dataframe as below which details additional calls into an area: CommsDate Area Day0 Incremental Day1 Incremental Day2 Incremental 01/01/24 Sales 43 36 29 01/01/24 Service 85 74 66 02/01/24 Sales 56 42 31 02/01/24 Service 73 62 49 03/01/24 Sales 48 32 24 03/01/24 Service 67 …

Total answers: 1

TKinter – Column width = 0 leaves yellow pixels

TKinter – Column width = 0 leaves yellow pixels Question: I am trying to only show certain columns when pressing one of the buttons on the right side, for that reason I implemented to hide the other columns by reducing their column width to 0. While this works for hiding the columns, it leaves yellow …

Total answers: 1

How to prevent matplotlib from plotting the "day number" on an axis

How to prevent matplotlib from plotting the "day number" on an axis Question: I am seeing a slightly annoying issue when plotting some data with matplotlib. As shown in the example output below, the x-axis has a slightly unexpected format. The labels are (for example) 04 12:30. The 04 being the day of the month. …

Total answers: 1

apply different function on each row

apply different function on each row Question: I have a dataframe with 2 columns field and value(number of rows maximum 10). I need to perform some checks depending on the field(ie need to apply different function on each row) and store its result in status column. Below is sample: data = { ‘field’: [‘a’, ‘b’], …

Total answers: 3