Questions tagged [pandas]

Ask Question

Pandas is a Python library for data manipulation and analysis, e.g. dataframes, multidimensional time series and cross-sectional datasets commonly found in statistics, experimental science results, econometrics, or finance. Pandas is one of the main data science libraries in Python.

248,128 questions 4

0votes0answers5views

Cannot use porter stemmer on own data: Error if is_scalar(key) and isna(key) and not self.hasnans:

I am new to NLP. I was trying to replicate one of the tutorials () on my own data. The tutorial runs ... user avatar Rahul Paul

  • 1
0votes1answer19views

splitting a dataframe based on row count python

I have a csv that is pretty large and I'm trying to split it up into smaller chunks. This kind of works but takes the rows of the original csv not the output dataframe rows. I'm looking to break the ... user avatar GiarcEnoredlac

  • 11
-1votes2answers13views

Calculate the prorata weight of a list of numbers (including negative) in Python

I am looking for a way to distribute a positive number proportionally to a list of numbers based on their value (higher gets more). Think of it as distributing a fixed bonus amount based on everyone's ... user avatar DOt dot

  • 1
-1votes0answers7views

Pandas Groupby AttributeError: 'function' object has no attribute 'groupby' I am trying to aggregate the data per customer using the groupby()

>>> #aggregrate data per customer >>> import pandas as pd >>> aggs = ['sum','mean','median','min','max'] >>>Trans_per_customer=Transaction_data.groupby('ClientID').... user avatar Frank

  • 1
1vote1answer7views

Copy a Multi-Index column of a Pandas Dataframe including the second header

Background - I have a dataset with two headers that I've read from a CSV... df = pd.read_csv(file, header=[0,1]) print(df) A B C a b c --------------- 0 1 2 3 1 4 5 6 ... user avatar MoTrip

  • 107
-1votes0answers6views

FutureWarning: KeyError in a future version. Use a timezone-aware object instead. how can I convert and fixed?

single_building_data = pd.DataFrame(temporal[singlebuilding].tz_convert(single_timezone).truncate(before=single_start,after=single_end)) user avatar Mustafa Al-Qayssei

  • 1
0votes1answer26views

In Python, remove both duplicates to a new dataframe while ignoring NaN ( empty cells)

I have a dataframe with duplicates in Animals. I want to parse out both rows if there is a duplicate in Animals into a new df. I'm having issues with the both part. Input df: Animals Stuff 0 Cow ... user avatar feelsgood

  • 47
0votes1answer9views

Resampling and plotting dataframe in pythong

I am trying to resample and plot the AverageTemperature column of a dataframe based on the values of 2 other columns (Country and City) but I keep getting an error that I can't seem to resolve. Note: ... user avatar Chase Asbby

  • 11
0votes0answers8views

Numba - how to return multiple columns ( arrays) - after group by apply

I would like to run groupby and then apply Numba function on top of a pandas. This is the example : @nb.jit(nopython=True) def my_Numba_function(arr1,arr2): arr1[:] =11 arr2[:] =22 ... user avatar Boris

  • 1,905
1vote1answer25views

Explode elements in braces/curly brackets separated by comma and no space (e.g. {a,b})

I have a DataFrame that looks somewhat like this: df = pd.DataFrame({'A': ['a', 'b', 'x', 'y'], 'B': ['{c,d}', '{e,f,g}', '', '{}']}) I want to remove the braces/curly brackets ... user avatar KitKat99

  • 23
-1votes0answers10views

Iterating Through Pandas Dataframe Dict, and Outputting The Same Row From All of Them

I creating a DataFrame from an excel file, and am attempting to take the data from the same row on several of the separate sheets. I can take it from a single sheet by doing the following import ... user avatar Dominick R

  • 1
0votes1answer16views

Pandas split dataframe on grouped index

Given a dataframe like df = pd.DataFrame({ 'A': ['a', 'b', 'b'], 'B': ['x', 'x', 'y'], 'C': [1, 2, 3] }) agg = df.groupby(['A', 'B']).agg('sum') I get C A B a x 1 b x 2 b y 3 Now I ... user avatar shane

  • 1,632
0votes0answers6views

df IndexError only with with parameter query

I'm experiencing an interesting error. If my query uses a fixed value for the criteria that is returned to a PANDAS data frame, I can successfully reference the returned data. However, I'm expanding ... user avatar bs0d

  • 103
0votes0answers8views

Using specific column and cells in Excel workbook using Python

Python scrub here and I have an excel spreadsheet I'm importing into my Python script using Pandas and I'm having some issues with the 2D Arrays. Basically, I have the Excel workbook under the ... user avatar maboom89

  • 15
-1votes0answers13views

How to fix this, i have a data frame the include coordinates of lat and long how i can get the street name out of geopy. i did try make this

i did try to make this but it keep telling me value Error must be a point or coordinates pair, while if i put the data manually it works. locdf = pd.read_csv("location.csv",na_values= ... user avatar omar ajwah

  • 1

153050per page

1 2 3 4 516542

You Might Also Like