Questions tagged [series]

A Series object represents a data series. This may be represented as the SeriesCollection class (Java, C#) or Series class in Python Pandas.

  • A series is not necessarily plotted on a chart; it can store data point values that are used to perform a calculation from which another series is created and then plotted. More info available on MSDN.

  • This tag is also used in the context of questions on [pandas] Series. See the pandas tag wiki for more details.

Also see:

3544 questions
1
vote
0 answers

Why do we need Python pandas Series?

I am learning Python. As far as I understand, Pandas includes Series and DataFrame data structures. It seems to me that Series is just a DataFrame with one column (along with the index column). Why then, do we need the Series data structure? Is the…
Abe
  • 11
  • 4
1
vote
2 answers

Pandas : Replace values multiple times until the end

I have a pandas df like this: import pandas as pd df = pd.DataFrame({'sales':[114,114,114,113,12,10,8500,8666]}) It is cumulative data from sales. There is a bug in the data : Some observations are wrong. (No value can be greater than the…
SciPy
  • 5,412
  • 4
  • 18
  • 18
1
vote
1 answer

How to write an expression that creates a pandas series from a larger pandas dataset?

I am being asked to "write an expression that returns a pandas Series with just the names in the name column." Below is the code which returns a large pandas dataset with three columns: 'name', 'sex', 'births'. Even after studying pandas series…
Danny
  • 45
  • 2
  • 4
1
vote
1 answer

how to drop duplicates in pandas when entries are sets

I have a series whose entries are sets. I want to remove all duplicate entries, using pandas.Series.drop_duplicates() but get an error. Here is an example: import pandas as pd ser = pd.Series([{1,2,3}, {4,5,6}, {4,5,6}]) ser.drop_duplicates() The…
splinter
  • 3,727
  • 8
  • 37
  • 82
1
vote
2 answers

Add 2 dataframes with no exact index values

I have this df: df1 t0 ACER 50 BBV 20 ACC 75 IRAL 25 DECO 58 and on the other side : df2 t1 ACER 50 BBV 20 CEL 0 DIA 25 I am looking forward to add both dfs to obtain the…
JamesHudson81
  • 2,215
  • 4
  • 23
  • 42
1
vote
3 answers

Strcmp() in "series"

I want to compare some strings, but unfortunately I don't find any proper way to do it. The idea behind is to ask for a keyboard input, read a variable, one symbol and if it is "y" or "n" ("yes" or "no" apparently) it executes certain activities. If…
1
vote
2 answers

Concatenating Series using the addition (+) operator?

So this is more of a question than a problem i have. I wanted to .append() some pandas series' together and without thinking i just did total=series1+series2+series3. The length of each series is 2199902,171175, and 178989 respectively and…
mystery man
  • 417
  • 2
  • 5
  • 15
1
vote
1 answer

substring using slice and a dataframe series as an end

I have a dataframe as such: Blockquote df Out[458]: strings 0 lui sau chun 1 d1420152 2 98764879333 3 minglee 4 g1927384 5 hannah What I would like to do is to extract 2/3rd's of the string for each value in the strings…
Sunday
  • 89
  • 2
  • 2
  • 5
1
vote
1 answer

VBA: `Object doesn't support this property or method (Error 438)` when trying to use a With statement to format a chart series collection

I am trying to re-write some code created with the macro recorder whilst formatting a line on a chart. I have tried numerous ways of re-writing the syntax so i can use a With statement to avoid any .Activate or .Select. My code is failing with error…
QHarr
  • 83,427
  • 12
  • 54
  • 101
1
vote
2 answers

Turn series to dataframe with certain dimension

I have a series with 5 value 0 A 1 A 2 B 3 C 4 E And I have a dataframe A with n columns. Is there any way I can make a dataframe that dimension is (5*n). All columns is made up by the series and column names are the same as…
Lee Tom
  • 93
  • 9
1
vote
1 answer

input text file (a double quoted string w/ %e %i sqrt z1 z2 log) into sympy or numpy or scipy for a Laurent series

Lengthy title, but I thought it might be best to be very informative... I have very long expressions using symbols such as %i, %e, log, z1 and z2, that is sandwiched in between double quotes, e.g. something…
nate
  • 269
  • 2
  • 11
1
vote
1 answer

Comparing two dateframes and setting values

I have a question and I am not sure what function should be used to perform it. I have two date frames where I wanna two compare if the values in one (finaldf) are higher than the values in the other one (dfres0) and if they are I wanna to set to…
May Emanuel
  • 133
  • 8
1
vote
3 answers

Attempting to subtract the values between two different Pandas Series based on corresponding indices

Here are the two series. They were generated after grouping a dataframe based on two column values, patient_id and event_description: Series 1: patient_id event_description A …
madsthaks
  • 2,091
  • 6
  • 25
  • 46
1
vote
4 answers

Identify location of missing keys that produce KeyError

I have a list of about 58,000 rows, and each row is a dictionary. Example: my_list_of_dicts = [{'id': '555', 'lang': 'en'}, {'id': '444', 'lang': 'en'}, {'id': '333', 'lang': 'fr'}, {'id': '222', 'lang': 'es'}, {'id': '111', 'lang':…
TJE
  • 570
  • 1
  • 5
  • 20
1
vote
3 answers

How to merge/combine two rows within a column/Series in a DataFrame when the two rows' values are different?

I have a DataFrame, and one column is "lang" for "language." Two different values in this column are "en" for "English" and "en-gb" for "British English." There are numerous other values in this row, including "es" for "Spanish, "fr" for "French,"…
TJE
  • 570
  • 1
  • 5
  • 20
1 2 3
99
100