我有一个Pandas DataFrame,混合了屏幕名称,推文,收藏等.我想找到'favcount'的最大值(我已经做过)并且还返回'tweet'的屏幕名称
df = pd.DataFrame()
df['timestamp'] = timestamp
df['sn'] = sn
df['text'] = text
df['favcount'] = fav_count
print df
print '------'
print df['favcount'].max()
Run Code Online (Sandbox Code Playgroud)
我似乎无法找到任何相关内容,任何人都可以帮助指导我朝着正确的方向前进吗?
我正在尝试根据此资源创建一个d3饼图.
但是,我收到以下错误:
未捕获的类型错误 - 无法读取未定义的属性"饼"
我的代码:
class PieChart extends React.Component {
constructor() {
super();
// - This is where the error is occuring!
this.pie = d3.layout.pie().value((d) => d.value);
this.colors = d3.scale.category10();
}
arcGenerator(d, i) {
return (
<LabeledArc key = {`arc-${i}`}
data = {d}
innerRadius = {this.props.innerRadius}
outerRadius = { this.props.outerRadius }
color = {this.colors(i)} />
);
}
render() {
console.log('Render Method Fires');
let pie = this.pie(this.props.data),
translate = `translate(${this.props.x}, ${this.props.y})`;
return (
<g transform={translate}>
{pie.map((d, i) => …Run Code Online (Sandbox Code Playgroud) 我有每天由用户通过表单添加的数据.这些领域中的一些记录温度:ambcur,:ambmin,:ambmax等这是托盘的所有部分,其中包含数据记录
我正在使用chartkick并且很棒,但我不确定如何随时间显示数据.
我试图做一个多重系列线图.
<%= line_chart [
{name: "Series A", data: @tray.datalogs.ambcur},
{name: "Series B", data: @tray.datalogs.ambmin}
] %>
Run Code Online (Sandbox Code Playgroud)
此外,单个线图也不起作用.
<%= line_chart @tray.datalogs.group(:ambcur).count %>
Run Code Online (Sandbox Code Playgroud)
有人可以帮助引导我朝着正确的方向前进吗?谢谢 :)