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
1 answer

Why use reset_index(drop=True) when setting the index is much faster?

Why would I use reset_index(drop=True), when the alternative is much faster? I am sure there is something I am missing. (Or my timings are bad somehow...) import pandas as pd l = pd.Series(range(int(1e7))) %timeit l.reset_index(drop=True) # 35.9…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
1
vote
2 answers

Why does Python function return 1.0 (float) when `return 1` is specified?

I have a lot of strings, some of which consist of 1 sentence and some consisting of multiple sentences. My goal is to determine which one-sentence strings end with an exclamation mark '!'. My code gives a strange result. Instead of returning '1' if…
twhale
  • 725
  • 2
  • 9
  • 25
1
vote
1 answer

How to create 2D array in python

I'm trying to create a function called "words_in_texts" to get the result like this words_in_texts(['hello', 'bye', 'world'], pd.Series(['hello', 'hello world hello']) array([[1, 0, 0], [1, 0, 1]]) I believe that the…
1
vote
1 answer

Combine BarChart and PointChart

i got a Little "Problem", i want to create a Chart looking like this: So basically Series 1 = Normal bar Chart. Color green if it Ends before the "time max" (series2) Series 2 = just a DataPoint / Marker on top of series 1 items. I am struggling…
christian890
  • 147
  • 1
  • 12
1
vote
2 answers

replace values in series according to threshold

I have a pandas series and I would like to replace the values with 0 if the value < 3 and with 1 if the value >=3 se = pandas.Series([1,2,3,4,5,6]) se[se<3]=0 se[se>=3]=1 Is there a better/pythonic way to do so?
gabboshow
  • 5,359
  • 12
  • 48
  • 98
1
vote
1 answer

C# How to add data to a dynamically added MSChart?

I'm currently trying to add data to my chart that I created dynamically. I've got a class (AddGraph) with following method: public class AddGraph { public string Name { get; set; } Random R = new Random(); …
C.User
  • 153
  • 18
1
vote
1 answer

Two DataSeries for yAxis 1 and 2 with Data from SQLdb

I'm new here and not really experienced with highcharts / javascripts and variable data from SQL. The Situation is that I've got three Pi3 with DHT22 Sensor, the Scripts on the Pis working well, the data is stored to my NAS into a Maria5 DB. I've…
Outi
  • 11
  • 2
1
vote
1 answer

Python, calling a pandas series starting with number

I have a dataframe with 124 columns, one of these columns is named '1ST', thus when I try to call it I get this error: [IN]: print(data.1ST) [OUT]: File "", line 1 print(data.1ST) ^ …
Jerry Fanelli
  • 81
  • 1
  • 2
  • 6
1
vote
1 answer

How to create multiple colors / series for a MSChart

I have a MYSQL Database and I've got it linked to a chart in my .Net application. However, I have 5 x values to display (so 5 bars) but they all are the same color, and I'd prefer to have them each a different color. I believe I have to do it with…
VINCEND
  • 13
  • 2
1
vote
2 answers

python: How to sum a series using an increment number

n = int(input('Enter n: ')) count = 1 sum = 0 number = 1 while (count <= n): sum = sum + number count = count + 1 number = number + 2 print('Sum =', sum) Is it possible to use the same concept for 1 + 4 + 9 + 16 + 25 + 36 + 49 + 64 ....…
john123
  • 11
  • 2
1
vote
2 answers

Check if Pandas DF Column1 Contains (str) Column2

I'm trying to create a column in a Pandas DataFrame that shows whether a (string) 'Column1' contains the string in 'Column2'. Reproduceable example below: # Have df = pd.DataFrame({'col1': ['a', 'aa', 'b', 'bb', 'c', 'cc'], …
Max Power
  • 8,265
  • 13
  • 50
  • 91
1
vote
3 answers

How to merge multiple pandas series to a dataframe, where series have list of values

I want to make a pandas Dataframe with following columns. my_cols = ['chrom', 'len_of_PIs'] and following values inside specific columns: chrom = pd.Series(['chr1', 'chr2', 'chr3']) len_of_PIs = pd.Series([[np.random.randint(15, 59, 86)], …
everestial007
  • 6,665
  • 7
  • 32
  • 72
1
vote
1 answer

Adjust Pandas Series Using np.where (Avoid ValueError: The truth value of a Series is ambiguous.)

I have the following pandas series that I'm trying to adjust in an if/else manner depending on if the value in the series equals 'Unspecified'. I have been reviewing as much material on this common error in pandas but it doesn't seem to be helping.…
Keenan Burke-Pitts
  • 475
  • 2
  • 6
  • 17
1
vote
1 answer

How to calculate a sumatory of a series?

I'm trying to calculate the sumatory of a series and I don't know what is my mistake because I don't get the right result. The sumatory that I have to calculate is this Here, Z(n,i) is a numeric vector ordered from the samllest to the…
Fabio
  • 35
  • 1
  • 1
  • 6
1
vote
0 answers

how to write this sum of series in Matlab?

how to write this summation in matlab if k=1,..n, and stored at each iteration of k ,i.e Edit I tried to use the solution in symbolic clear;clc h=0.1; x=0:h:2;n=10;m=3; w = @(i,j,k) (-1)^(i+j)*cos((j*pi/h)*(x-x(k))); syms I J J=1:m; for…
workwolf
  • 53
  • 6