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
3 answers

Look for subsets of keywords in a Pandas Series (Python)

I'm working with Series that look pretty much like this: l0 = ['smartphone', 'battery', 'case', 'grey', '10071852'] l1 = ['phone', 'new', 'charging', 'case', 'white'] l2 = ['tablet', 'phone', 'pin', 'adapter', 'ex766'] l3 = ['phone', 'silicon',…
Notna
  • 491
  • 2
  • 8
  • 19
1
vote
3 answers

Pandas Series.ne operator returning unexpected result against two slices of same Series

So I have this series of integers shown below from pandas import Series s = Series([1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) And I want to see how many times the…
Hunter Jackson
  • 315
  • 2
  • 10
1
vote
3 answers

Clamping to next lowest value in a series

I'm trying to clamp a number to the lower value of a series of numbers. For instance, if I have a series (sorry for the bad notation) [pq] where p is any integer and q is any positive number. Say if q is 50 my series will be ...-150, -100, -50, 0,…
Archmede
  • 1,592
  • 2
  • 20
  • 37
1
vote
1 answer

How to convert a series into an index of another series, aligned by their indexes

I have this series: dealer certificate_status brand_kia aeropuerto NO False 22 days True 29 days Galerías SI False 59 days NO …
felocru
  • 23
  • 4
1
vote
2 answers

How to get the N nearest entries to the median in a Pandas series?

For a Pandas Series: ser = pd.Series([i**2 for i in range(9)]) print(ser) 0 0 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 dtype: int64 The median can be grabbed with ser.median(), which returns 16. How can the N entries…
user1717828
  • 7,122
  • 8
  • 34
  • 59
1
vote
1 answer

How to correctly add a series of time values to an Excel chart

I am trying to add a series composed of Time values to a chart. The y-axis is formatted as Time. I am using the variable myVal to hold the value I want to repeat, inside an array, as the series plot values. I know that Time is stored in the Date…
QHarr
  • 83,427
  • 12
  • 54
  • 101
1
vote
2 answers

pandas series sub-setting by index

Here is my example: import pandas as pd df = pd.DataFrame({'col_1':[1,5,6,77,9],'col_2':[6,2,4,2,5]}) df.index = [8,9,10,11,12] This sub-setting is by row order: df.col_1[2:5] returns 10 6 11 77 12 9 Name: col_1, dtype: int64 while…
user1700890
  • 7,144
  • 18
  • 87
  • 183
1
vote
4 answers

largest element all lists in Panda Series

I have a pandas series say import pandas as pd a = pd.Series([ [1, 2, 3, 4, 5], [6, 7, 8, 3, 334], [333, 4, 5, 3, 4] ]) I want to find the largest element in all lists, which is 334, what is the easy way to do it?
william007
  • 17,375
  • 25
  • 118
  • 194
1
vote
1 answer

concat sliced dataframes preserving original series order

I have three lists, [1,4,3] , [2,5,6] , [9,8,7] which refer to a dataframe's series indices. I'm using each list to slice the dataframe into a smaller dataframe for batch data processing. After the processing, I want to recombine the dataframes into…
joshi123
  • 835
  • 2
  • 13
  • 33
1
vote
1 answer

output where pandas Series of booleans is True

I have a Series created like this s = pd.Series({'a': False, 'b': True, 'c': False, 'd': True, 'e': False}) >> s a False b True c False d True e False dtype: bool Is there a way to neatly extract the names of where it is True,…
cardamom
  • 6,873
  • 11
  • 48
  • 102
1
vote
2 answers

simplify python/pandas code

My data looks like this: 1516268134 49.95 99.982 49.95 0 0 0 0 0 0 0 1516268134 49.95 99.966 49.95 0 0 0 0 0 0 0 1516268134 49.95 100.28 49.95 0 …
1
vote
1 answer

Slice a Pandas Dataframe based on the results of a function on a column

I want to slice a dataframe using a condition based on a DateTime column's month, element by element: Met_Monthly_DF = Metsite_DF.iloc[Metsite_DF['DateTime'].month == Month] I get the error: builtins.AttributeError: 'Series' object has no attribute…
1
vote
2 answers

DB2 SQL Finding rows with a gap of 1 minute with other rows

DB2 v10.5.0.5 on Linux I have a table of something like: LOG_IN | LOG_OFF ----------------------------------------- 2017-01-22 08:00:00 | 2017-01-22 09:00:00 2017-01-22 09:01:00 | 2017-01-22 10:00:00 2017-01-22 10:00:00 | 2017-01-22…
turkongwalayr
  • 33
  • 1
  • 7
1
vote
1 answer

VB.net formatting series and removing 1 legend entry

I've got some VB.NET code which uses Excel to create a chart from some data. The chart works how it should but I'm finding the switch from VBA to VB formatting-wise difficult. I want just series 1 in the legend to be deleted and the data in the…
Sean Kilburn
  • 129
  • 5
1
vote
0 answers

Python 'Can only compare identically-labeled Series objects'

I'm looking to append a column onto my csv file where it iterates through the csv then receieves the count of the symbol from another csv and appends it to that corresponding row. #created the function that takes the input of the symbol passed def…
guy ritche
  • 11
  • 3