series

pandas Timedelta error

淺唱寂寞╮ 提交于 2020-01-06 10:14:09
问题 I'm getting errors when running the code samples from the pandas documentation. I suspect it might be related to the version of pandas I'm using, but I haven't been able to confirm that. pandas VERSION 0.10.1 numpy VERSION 1.7.0 scipy VERSION 0.12.0.dev-14b1e07 The below examples are taken directly from the pandas documentation here: pandas - Time Deltas This works from datetime import datetime, timedelta from pandas import * s = Series(date_range('2012-1-1', periods=3, freq='D')) s Out[52]:

Find the highest and lowest value locations within an interval on a column?

血红的双手。 提交于 2020-01-05 07:53:06
问题 Given this pandas dataframe with two columns, 'Values' and 'Intervals'. How do I get a third column 'MinMax' indicating whether the value is a maximum or a minimum within that interval? The challenge for me is that the interval length and the distance between intervals are not fixed, therefore I post the question. import pandas as pd import numpy as np data = pd.DataFrame([ [1879.289,np.nan],[1879.281,np.nan],[1879.292,1],[1879.295,1],[1879.481,1],[1879.294,1],[1879.268,1], [1879.293,1],[1879

Display MySQL Query in ASP Chart using multiple series

不羁岁月 提交于 2020-01-05 05:25:29
问题 I have this table. https://www.dropbox.com/s/7xf6ibn5mr9f9yf/test4.PNG?dl=0 Basically, I want to display "AttendDet_Type" which is P, A and MC as the x-axis using multiple series (which will look like this - https://www.dropbox.com/s/v15pp818tmgf8co/test5.PNG?dl=0) and COUNT(AttendDet_Type) as the y-axis. I managed to display AttendDet_Type for P using asp chart but I totally have no idea how to code multiple series to display A and MC. Can anyone help me out? My ASP Code <asp:Chart ID=

Display MySQL Query in ASP Chart using multiple series

旧时模样 提交于 2020-01-05 05:25:05
问题 I have this table. https://www.dropbox.com/s/7xf6ibn5mr9f9yf/test4.PNG?dl=0 Basically, I want to display "AttendDet_Type" which is P, A and MC as the x-axis using multiple series (which will look like this - https://www.dropbox.com/s/v15pp818tmgf8co/test5.PNG?dl=0) and COUNT(AttendDet_Type) as the y-axis. I managed to display AttendDet_Type for P using asp chart but I totally have no idea how to code multiple series to display A and MC. Can anyone help me out? My ASP Code <asp:Chart ID=

VBA Chart series set Color Fill to “Automatic”

让人想犯罪 __ 提交于 2020-01-05 04:37:12
问题 I want to highlight some series in my stack chart - this is I have implemented. But the chart is dynamic, so when I change selection I need to highlight other series. But what was highlighted previously remains highlighted. I am thinking to tun a cycle through all series and assign Fill Color of the series as "Automatic" each time when I change the source. Then I could highlight the needed series. I have have found 2 options to sent the color using properties .Interior.Color OR .Format.Fill

Adding Dates (Series) column from one DataFrame to the other Pandas, Python

时光总嘲笑我的痴心妄想 提交于 2020-01-04 11:03:09
问题 I am trying to 'broadcast' a date column from df1 to df2. In df1 I have the names of all the users and their basic information. In df2 I have a list of purchases made by the users. df1 and df2 code Assuming I have a much bigger dataset (the above created for sample) how can I add just(!) the df1['DoB'] column to df2? I have tried both concat() and merge() but none of them seem to work: code and error The only way it seems to work is only if I merge both df1 and df2 together and then just

How to apply ShapeStyle to a specific Series of a Chart in Excel using VBA?

痴心易碎 提交于 2020-01-04 01:57:08
问题 How do I programatically apply a ShapeStyle to a set of Points from a single Series of a Chart using vba? It seems I need a "Shapes" object that contains only the points from the series I am trying to format? Some information is here: http://peltiertech.com/WordPress/programming-excel-2007-2010-autoshapes-with-vba/ under the "Setting Border and Fill Styles" section I have pseudocode but I have no idea how to create the Shapes object with only the items I want in it ' Applies desired

python pandas- AttributeError: 'Series' object has no attribute 'columns'?

懵懂的女人 提交于 2020-01-03 17:27:06
问题 I am trying to count the number of times the current row's value for a specific column 'df1' falls between the low-high range values in the previous 5 rows (in 2 side by side columns). This is a follow-up question - Dickster has already done the heavy lifting here. The Series().between() method is not cooperating, complaining that AttributeError: 'Series' object has no attribute 'columns' . I don't understand how I am involving the columns attribute. list1 = [[21,101],[22,110],[25,113],[24

How to demonstrate sigma(i/2^i)<=2 (i=1 to n)

南笙酒味 提交于 2020-01-03 07:03:24
问题 How to demonstrate following Unequal: sigma(i/2^i)<=2 (i=1 to n) 回答1: If we look at the series then it looks like: We consider n = infinity for maximum value of sum. S = 1/2 + 2/4 + 3/8 + 4/16 + 5/32 +.... + 0 -(1) Clearly, S/2 = 1/4 + 2/8 + 3/16 + 4/32 + ---- + 0 -(2) Subtracting (1) from (2) we get: S/2 = 1/2 + 1/4 + 1/8 + 1/16 + 1/32 +... + 0 In this a = 1/2 and r = 1/2 so sum of this infinite gp is a/(1-r) = 1/2/(1-1/2) = 1 So maximum value of S/2 is 1 then maximum value of S is 2 or S <=

How to update series based on other pandas dataframe

限于喜欢 提交于 2020-01-03 04:02:29
问题 I want to update data based on other pandas dataframe because I just gather better data, here's the example of dataset Heres my Data No Country Language Capital 1 Indonesia Bahasa Jakarta 2 Malaysia Bahasa Kuala Lumpur 3 Brunei Bahasa Bandar Seri Begawan 4 Nigeria English Abuja My second dataframe Nation Capital City Malaysia Lagos Nigeria Putrajaya What I want is No Country Language Capital 1 Indonesia Bahasa Jakarta 2 Malaysia Bahasa Putrajaya 3 Brunei Bahasa Bandar Seri Begawan 4 Nigeria