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
- Bountied 4
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
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 ... python-3.x pandas dataframe nlp
Rahul Paul
- 1
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 ... python pandas dataframe csv
GiarcEnoredlac
- 11
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 ... python pandas numpy statistics data-science
DOt dot
- 1
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').... python pandas dataframe pandas-groupby
Frank
- 1
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 ... python pandas dataframe multi-index
MoTrip
- 107
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)) python pandas
Mustafa Al-Qayssei
- 1
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 ... python pandas dataframe nan
feelsgood
- 47
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: ... python pandas dataframe
Chase Asbby
- 11
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 ... pandas pandas-groupby numba pandas-apply
Boris
- 1,905
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 ... python pandas dataframe
KitKat99
- 23
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 ... python python-3.x pandas dataframe
Dominick R
- 1
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 ... python pandas dataframe
shane
- 1,632
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 ... python sql pandas dataframe
bs0d
- 103
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 ... python pandas
maboom89
- 15
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= ... python pandas geopy
omar ajwah
- 1
153050per page