使用Matplotlib Numpy Pandas构想泰坦尼克号高潮

Did you know, a novel predicted the Titanic sinking 14 years previously to the actual disaster???

您知道吗,一本小说预言泰坦尼克号在14年前沉没到了真正的灾难中???

In 1898 (14 years before the Titanic sank), American author Morgan Robertson wrote a novel titled ‘The Wreck of the Titan.’

1898年(泰坦尼克号沉没之前的14年),美国作家摩根·罗伯森(Morgan Robertson)写了一本名为《泰坦号的残骸》的小说。

The book was about a fictional ocean liner that sinks due to a collision with an iceberg. In the book, the ship is described as being “unsinkable” and doesn’t have enough lifeboats for everyone on board, sounds familiar yeah you’re right it’s the epic story of titanic which was predicted years ago.

这本书是关于一个虚构的远洋客轮,由于与冰山相撞而沉没。 在这本书中,这艘船被描述为“不沉”,船上没有足够的救生艇供所有人使用,听起来不错,是的,这是多年前预言的泰坦尼克号的史诗故事。

Image for post
The Wreck of Titan
泰坦残骸

We cannot conclude whether the author had technical proofs for his prediction, but we as responsible Data science enthusiasts can predict the possibilities and outcomes of the disaster using the data set and what not we can even try to envision the various prospects of the climax.

我们无法断定作者是否有预测的技术证据,但是作为负责任的数据科学爱好者,我们可以使用数据集来预测灾难的可能性和后果,而我们甚至不可以尝试设想高潮的各种前景。

I am sure that all of us know what happened to Rose and Jack in the movie Titanic. We all wished that the story had a different ending, didn’t we? Let’s try to make our wish come true by recreating the climax of the story by a simple analysis of the story plot,

我确定我们所有人都知道电影《泰坦尼克号》中罗斯和杰克的事。 我们都希望这个故事有一个不同的结局,不是吗? 让我们通过对故事情节的简单分析来重现故事的高潮,以实现我们的愿望,

At the end of the analysis we will be creating three climaxes and come to know the answer of three questions:

在分析的最后,我们将创建三个高潮,并了解三个问题的答案:

• Is there a possibility for jack to be alive and rose’s survival?

•杰克有可能活着并生存下来吗?

• Was there a chance for Jack and Rose together to narrate their adventurous story to their grandchildren?

•杰克和罗斯有没有机会向孙子们讲述他们的冒险故事?

• Did Cal Hockley (Rose’s Fiancé) have a higher chance of survival as he belonged to the upper-class or what would make the villain dead?

•卡尔·霍克利(罗斯的未婚妻)是属于上流社会的人,他有更高的生存机会吗?或者会使小人丧生?

We are carrying out our analysis using the ‘Matplotlib’, ‘Numpy’,’Pandas’, and ‘Seaborn’ Libraries.

我们正在使用“ Matplotlib”,“ Numpy”,“ Pandas”和“ Seaborn”图书馆进行分析。

Let us see what each library function is:

让我们看看每个库函数是什么:

Matplotlib is a python library used for visualizing data sets using various plots; it has more than 50 plots to name a few, bar plot, line plot, histogram, etc.

Matplotlib是一个python库,用于使用各种图表可视化数据集。 它有50多个图,例如条形图,线形图,直方图等。

Numpy is also a Python library that provides a high-performance multidimensional array and basic tools to compute with and manipulate these arrays.

Numpy还是一个Python库,它提供了高性能的多维数组和基本工具,可以使用这些数组进行计算和操作。

Pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series.

Pandas是为Python编程语言编写的用于数据处理和分析的软件库。 特别是,它提供了用于处理数字表和时间序列的数据结构和操作。

Seaborn is a Python data visualization library based on Matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.

Seaborn是基于Matplotlib的Python数据可视化库。 它提供了一个高级界面,用于绘制引人入胜且内容丰富的统计图形。

Let us start our journey…

让我们开始我们的旅程...

数据探索: (Data Exploration:)

import pandas as pd
import numpy as np
import random as rnd
# visualization
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline

We import all the necessary libraries and read the data set which has the stat of titanic disaster using the ‘pandas’ library.

我们导入所有必需的库,并使用“ pandas”库读取具有泰坦尼克号灾难状态的数据集。

titanic_df = pd.read_csv('titanic.csv')

Then we display the first five entries using the head command to get a glimpse of the nature of the data and the categories of labels which we are going to explore,

然后,我们使用head命令显示前五个条目,以大致了解数据的性质以及我们将要探索的标签类别,

titanic_df.head()
Image for post
Titanic.csv First 5 entries
Titanic.csv前5个条目

功能分析: (Feature Analysis:)

Looking at titanic_df.describe() we gain a lot of useful insights and find the categorical labels which we can ignore

查看titanic_df.describe(),我们获得了许多有用的见解,并找到了我们可以忽略的分类标签

titanic_df.describe()
Image for post
Titanic.csv decribe command to see the column characteristics
Titanic.csv decribe命令以查看列特征

• PassengerId: Unique for each passenger so this has no relation with the survival label hence this need not be considered for analyzing

•PassengerId:对于每个乘客而言都是唯一的,因此它与生存标签没有关系,因此在分析时无需考虑这一点

• Survived: Survival is a binary option, 0 for the passenger is dead and 1 for the passenger is alive, so this will be only ‘Y’ variable in XY plotting

•Survived(生存):Survival(生存)是一个二进制选项,0表示乘客已死亡,1表示该乘客还活着,因此在XY绘图中这仅是“ Y”变量

• Pclass: Integer equal to 1, 2, or 3 indicating the class of each passenger (lower, middle, or upper), this can be taken for analyzing as this has three inner categories which may contribute to the survival of passengers

•Pclass:等于1、2或3的整数,表示每个乘客的等级(下层,中层或上层),这可以用于分析,因为它具有三个内部类别,可能有助于乘客的生存

• Age: Number representing the age of each passenger, though as we can see in titanic_df.tail(), some passengers have NaN for their age, this can also be considered as maybe younger ones can act swiftly and escape so this can also contribute to the survival label

•年龄:代表每位乘客的年龄的数字,尽管正如我们在titanic_df.tail()中看到的那样,有些乘客的年龄为NaN,这也可以被认为是年龄较小的乘客可以Swift行动并逃脱,因此这也可以有所作为到生存标签

• SibSp: Number of siblings also on board, we may not completely ignore this, as it may or may not support the survival label

•SibSp:船上也有兄弟姐妹,我们可能不会完全忽略这一点,因为它可能支持或可能不支持生存标签

• Parch: Number of children also on board, this also has a similar case of SibSp

•Parch:船上也有儿童人数,这也与SibSp类似

• Fare: amount paid for the ticket by each passenger, this may add essence to the Passenger Class label as the higher the fare higher the class of ticket.

•票价:每位乘客支付的机票金额,这可能会在“乘客舱位”标签上添加实质内容,因为票价越高,机票舱位越高。

For a quick comparison, we’ll create use NumPy functions to verify the mean, standard deviation, min, and max of numerical columns.

为了进行快速比较,我们将创建使用NumPy函数来验证数字列的均值,标准差,最小值和最大值。

columns = list(titanic_df[['PassengerId', 'Survived', 'Pclass', 'Age', 'SibSp', 'Parch', 'Fare']])def describe_data(data, col):
print ('\n\n', col)
print ('_' * 40)
print ('Mean:', np.mean(data)) #NumPy Mean
print ('STD:', np.std(data)) #NumPy STD
print ('Min:', np.min(data)) #NumPy Min
print ('Max:', np.max(data)) #NumPy Maxfor c in columns:
describe_data(titanic_df[c], c)
Image for post
Image for post
Mean, Standard Deviation, Minimum and Maximum values for each Label
每个标签的平均值,标准偏差,最小值和最大值

这些见解包括: (Insights from these are:)

• Survived is a categorical label with 0 or 1 values.

•Survived是具有0或1个值的分类标签。

• Around 38% of samples survived representative of the actual survival rate at 32%.

•大约有38%的样本存活下来,代表了32%的实际存活率。

• Most passengers (> 75%) did not travel with parents or children.

•大多数乘客(> 75%)没有和父母或孩子一起旅行。

• Nearly 30% of the passengers had siblings and/or spouse aboard.

•近30%的乘客有兄弟姐妹和/或配偶上车。

• Fares varied significantly with few passengers (<1%) paying as high as $512.

•票价差异很大,很少乘客(<1%)支付的费用高达512美元。

• Few elderly passengers (<1%) within the age range 65–80.

•65-80岁年龄段的老年乘客(<1%)很少。

Great numbers, Let us move on to realize our dream climaxes…

伟大的数字,让我们继续前进,实现我们的梦想高潮…

高潮1:杰克活着玫瑰死了! (Climax 1: Jack Lived Rose Died!!!)

Image for post
If Jack Survived…
如果杰克幸存下来...

The vice versa case where Jack narrated his love story to his grandchildren and Rose sadly died, is there a possibility for this? Let us examine by keeping in mind Jack is a male and he belongs to the lower class, and Rose is of Female gender belonging to Upper Class,

反之亦然,杰克向孙子讲述自己的爱情故事,而罗斯则不幸去世,这有可能吗? 让我们记住杰克是男性,他属于下层阶级,罗斯是女性,属于上层阶级,

We first need to break the analysis into several parts. First, we will look at the impact sex had on survival by pivoting the data frame.

我们首先需要将分析分为几个部分。 首先,我们将通过透视数据框来研究性别对生存的影响。

titanic_df.describe(include=['O'])
Image for post
titanic.csv description
titanic.csv说明
titanic_df[['Sex', 'Survived']].groupby(['Sex'], as_index=False).mean().sort_values(by='Survived', ascending=False)
Image for post
Male Female survival calculation
男女生存计算

This table shows us the percentage of females that survived and the percentage of males that survived. The female survival rate was 74.2%, and the male survival rate was 18.9%. The huge gap between these numbers is an immediate indication that the female survival rate on the Titanic was significantly higher than the male survival rate, and being a woman in fact increase Rose’s chances of survival.

该表向我们显示了女性存活率和男性存活率。 女性生存率为74.2%,男性生存率为18.9%。 这些数字之间的巨大差距立即表明,泰坦尼克号上的女性成活率明显高于男性成活率,而成为女性实际上增加了罗斯的生存机会。

titanic_df['AgeRange'] = pd.cut(titanic_df['Age'], 16)# Calculate proportion of surviors for each AgeRange
titanic_df[['AgeRange', 'Survived']].groupby(['AgeRange'], as_index=False).mean().sort_values(by='AgeRange', ascending=True)
Image for post
Age Range for survivors
幸存者的年龄范围
age_sex_hist = sns.FacetGrid(titanic_df, col='Survived', row='Sex', hue='Survived')
age_sex_hist.map(plt.hist, 'Age', bins=20)
Image for post
Age Gender Comparisons
年龄性别比较

This breakdown gives us an extremely interesting and informative view of the answer to survival rate for women and children. If we look at the data for children 5 and under, we can see that sex didn’t have much of an impact on survival. But in large, most of the children in this sample survived, including the males. Another interesting insight we can see is just how many of the males on board died (aside from male children under 5). Men were more likely to have died than to have survived. When we make the same comparison for females, you can see that females in almost every age range were more likely to survive than to have died. To validate the inferences made here, we can look at the numbers in a table once again, though it becomes harder to read with more variables. However, viewing this type of table can emphasize how helpful histograms can be for visualizing data.

这种分类为我们提供了关于妇女和儿童生存率答案的极其有趣和有益的见解。 如果我们查看5岁及以下儿童的数据,可以发现性别对生存没有太大影响。 但总体而言,此样本中的大多数儿童(包括男性)都得以幸存。 我们可以看到的另一个有趣的见解是,机上有多少男性死亡(5岁以下的男性儿童除外)。 男人比死者更有可能死。 当我们对女性进行相同的比较时,您可以看到几乎每个年龄段的女性生存的可能性都比死亡的可能性大。 为了验证此处所做的推论,我们可以再次查看表中的数字,尽管使用更多的变量将更难以阅读。 但是,查看这种类型的表可以强调直方图对可视化数据有多大帮助。

titanic_df[['Sex', 'AgeRange', 'Survived']].groupby(['Sex', 'AgeRange'], as_index=False).mean().sort_values(by='AgeRange', ascending=True)
Image for post
Image for post
Gender Age Range and Survival Comparisons
性别年龄范围和生存比较

Based on these observations and numbers, we can conclude that both women and children had a higher chance of survival and hence our Climax 1 has a lesser probability of realization also we could not change factors like gender and age to make it as per our wish, So there is lesser possibility of Rose dead and Jack Alive, Poor Jack!!!

根据这些观察和数字,我们可以得出结论,妇女和儿童都有较高的生存机会,因此我们的Climax 1的实现可能性较小,我们也无法根据自己的意愿改变性别和年龄等因素,因此,罗斯死亡和杰克活着,可怜的杰克的可能性较小!!!

Image for post
Poor Jack…
可怜的杰克...

高潮2:杰克和罗斯逃脱并过着幸福的生活! (Climax 2: Jack and Rose Escaped and lived happily!!!)

Imagine while rose was about finish her adventurous trip story, jack joins her and ends as, “that’s how your grandma and grandpa fell in love with each other and ended up together”

想象一下,当玫瑰即将结束她的冒险旅行故事时,杰克加入她并以“那是你奶奶和爷爷彼此相爱并最终在一起的方式”结尾

That’s the heart-warming climax one would ever want, so what all ways this could be realized, let us analyze the Passenger Class as it is one of the important labels in the titanic data set.

那将是一个令人心动的高潮,因此可以用什么方法实现,让我们分析一下旅客等级,因为它是泰坦尼克号数据集中的重要标签之一。

Were upper-class passengers more likely to have made it onto a lifeboat than middle and lower class passengers? Let us make it interesting by examining using bar and point plots.

上层阶级的乘客比中层和下层阶级的乘客更有可能登上救生艇吗? 让我们通过使用条形图和点图来使其有趣。

titanic_df['Passenger'] = 'Passenger'
# Create Class column with string values for class
titanic_df['Class'] = titanic_df['Pclass'].map( {1: 'Upper', 2: 'Middle', 3: 'Lower'} )# Create PointPlot for Passengers by Class
bp = sns.pointplot(x='Passenger', y='Survived', hue='Class', data=titanic_df, hue_order=['Lower', 'Middle', 'Upper'])
bp.set(ylabel='% Survivors', xlabel='Passenger Class')
Image for post
Point Plot
点图

This plot shows the average survival and confidence interval of passengers by class. Looking at the breakdown of average survival rates by class shows a correlation between class and rate of survival. Lower class passenger survival ranged somewhere between 20–30%, while upper-class survival ranged somewhere between 55–70%, with middle class ranging somewhere between 35–55%.

该图显示了按等级划分的旅客的平均生存和置信区间。 按类别查看平均存活率的细目分类显示类别与存活率之间的相关性。 下层阶级的乘客生存率介于20%至30%之间,而上层阶级的生存率介于55%至70%之间,中层阶级的生存率介于35%至55%之间。

So to make our Climax 2, come true what rose could have done is maybe instead of her joining Jack for the party in his lower passenger class, she could have taken Jack along with her to Upper Class and enjoyed the day, which may have kept them alive for a happy ending.

因此,要使我们的Climax 2成为现实,玫瑰所能做的可能不是代替她参加低级客舱的杰克派对,而是可以将杰克和她一起带到上层客舱并享受这一天,这可能使他们为了一个幸福的结局而活着。

Image for post
Jack and Rose
杰克和罗斯

高潮3:卡尔·霍克利,想让他死还是活??? (Climax 3: Cal Hockley, want him dead or alive???)

Cal Hockley, the villain who took advantage of Rose’s state and tricked her into his marriage proposal, also seemed to be escaped from the sink what could be the reason?

恶棍卡尔·霍克利(Cal Hockley)趁着罗斯(Rose)的州,骗她参加了求婚,似乎也从水槽中逃了出来,这可能是什么原因?

Let us explore in detail the passenger class and gender labels as they contribute more significantly and are varying parameters between Jack and Cal using seaborn plots

让我们详细研究旅客等级和性别标签,因为它们的贡献更大,并且使用海洋图在杰克和卡尔之间改变参数

bps = sns.barplot(x='Sex', y='Survived', hue='Class', data=titanic_df, hue_order=['Lower', 'Middle', 'Upper'])
bps.set(ylabel='% Survivors', xlabel='Passenger Sex by Class')
Image for post
Bar Plot
条形图

We can see that middle-class female passengers had almost the same rate of survival as upper-class females, but middle-class men had about the same rate of survival as lower classmen, which further illustrates the greater likelihood of women to have survived. Overall we can observe that upper-class passengers did indeed have a higher chance of survival than lower-class passengers regardless of sex.

我们可以看到,中产阶级女性乘客的生存率与上层阶级女性几乎相同,但是中产阶级男性的生存率与下层阶级的男性几乎相同,这进一步说明了女性生存的可能性更大。 总的来说,我们可以观察到,不论性别,上层旅客确实比下层旅客有更高的生存机会。

np.corrcoef(x=titanic_df['Pclass'], y=titanic_df['Survived'])
Image for post
Correlation Matrix
相关矩阵

A negative correlation tells us is that when class increases (1 → 2 → 3), survival decreases. So, since the lower class is represented as 3, the lower class is correlated with lower survival.

负相关告诉我们,当阶级增加时(1→2→3),生存率降低。 因此,由于较低的类别表示为3,因此较低的类别与较低的生存率相关。

Unfortunately, there are more chances for the survival of Cal Hockley!

不幸的是,卡尔·霍克利(Cal Hockley)有更多的生存机会!

Image for post
Cal Hockley
卡尔·霍克利

除了我们对Climax的假设外,还有一些限制: (Apart from our assumptions to the Climax, there are certain limitations:)

  • As some of these inferences were drawn based on correlation, it’s always important to remember that correlation does not imply causation (relationship).

    由于其中一些推论是根据相关性得出的,因此记住相关性并不意味着因果关系(关系)总是很重要的。
  • Since we know that some passengers did not have a recorded age, entries with ‘NaN’ (null) were not taken into account when running these numbers.

    由于我们知道有些乘客没有年龄记录,因此运行这些数字时不会考虑带有“ NaN”(空)的条目。
  • Conclusions were drawn based on descriptive statistics, charts, and opted not to run t-tests on the sample.

    根据描述性统计数据,图表得出结论,并选择不对样本进行t检验。

有趣的发现: (Interesting Findings:)

What proportion of passengers in the sample survived?

样本中有多少乘客幸存下来?

  • 38% of total passengers in the sample survived

    样本中38%的旅客幸存下来

Did women and children have a higher survival rate?

妇女和儿童的生存率更高吗?

  • The female survival rate in this sample was 55.3% higher than the survival rate for males.

    该样本中女性的生存率比男性的生存率高55.3%。
  • Women had a much higher rate of survival than men.

    女人的生存率比男人高得多。
  • Children under the age of 5, regardless of sex, had a much higher rate of survival

    5岁以下的儿童(不论性别)的存活率要高得多

Did upper-class passengers in the sample have an advantage that translated into a higher survival rate than lower-class passengers?

样本中的上等乘客是否具有比下等乘客具有更高的生存率的优势?

  • The class has a strong correlation with survival, with upper-class passengers having a much larger rate of survival than lower-class passengers, regardless of sex and age.

    班级与生存能力密切相关,不论性别和年龄,上层旅客的生存率都比下层旅客高得多。
  • Upper-class passengers were more likely to survive than lower-class passengers.

    上层旅客比下层旅客更有可能生存。

So, as we are approaching the climax of our post, quickly let’s summarize, we got some insights about Matplotlib, Numpy, pandas, and seaborn libraries which are essential and inevitable for data science.

因此,随着我们接近帖子的高潮,我们快速总结一下,我们对Matplotlib,Numpy,pandas和seaborn库有了一些见解,这对于数据科学是必不可少的。

Also instead of mourning on the loss of Jack and the separation of true love, we tried the possibilities to change the climax, what’s exactly the duty data scientist, to analyze the data and come up with useful possibilities to attain desired outcomes.

此外,我们没有为杰克的失落和真爱的分离而哀悼,我们尝试了改变高潮的可能性,这正是数据科学家的职责,它是对数据进行分析并提出有用的可能性来达到预期效果的方法。

Image for post

Now, it’s your turn pals to create your own customized climaxes and conclusions with these kinds of simple analysis of the data set and come up with creative and innovative endings of your favorite historical epics, kudos for learners!

现在,轮到您了,您可以通过对数据集的这种简单分析来创建自己的自定义高潮和结论,并为您喜欢的历史史诗提供创造性的和创新的结局,对学习者们表示敬意!

The End (Happy Ending)!

结局(幸福结局)!

You can find the code and dataset at:

您可以在以下位置找到代码和数据集:

https://github.com/PradeepaK1/Envision-the-Titatnic-Climax-with-Matplotlib-Numpy-Pandas

https://github.com/PradeepaK1/Envision-the-Titatnic-Climax-with-Matplotlib-Numpy-Pandas

Contributors:

贡献者:

Anjana M P — https://anjana21it.wixsite.com/mysite

Anjana MP- https: //anjana21it.wixsite.com/mysite

Pradeepa K — https://ptljkpd.wixsite.com/pradeepa

Pradeepa K- https: //ptljkpd.wixsite.com/pradeepa

翻译自: https://medium.com/diva-coders/envision-the-titanic-climax-with-matplotlib-numpy-pandas-d5568cc6d0cc

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/391746.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

pca数学推导_PCA背后的统计和数学概念

pca数学推导As I promised in the previous article, Principal Component Analysis (PCA) with Scikit-learn, today, I’ll discuss the mathematics behind the principal component analysis by manually executing the algorithm using the powerful numpy and pandas lib…

红黑树分析

红黑树的性质&#xff1a; 性质1&#xff1a;每个节点要么是黑色&#xff0c;要么是红色。 性质2&#xff1a;根节点是黑色。性质3&#xff1a;每个叶子节点&#xff08;NIL&#xff09;是黑色。性质4&#xff1a;每个红色节点的两个子节点一定都是黑色。不能有两个红色节点相…

overlay 如何实现跨主机通信?- 每天5分钟玩转 Docker 容器技术(52)

上一节我们在 host1 中运行了容器 bbox1&#xff0c;今天将详细讨论 overlay 网络跨主机通信的原理。 在 host2 中运行容器 bbox2&#xff1a; bbox2 IP 为 10.0.0.3&#xff0c;可以直接 ping bbox1&#xff1a; 可见 overlay 网络中的容器可以直接通信&#xff0c;同时 docke…

Python:实现图片裁剪的两种方式——Pillow和OpenCV

原文&#xff1a;https://blog.csdn.net/hfutdog/article/details/82351549 在这篇文章里我们聊一下Python实现图片裁剪的两种方式&#xff0c;一种利用了Pillow&#xff0c;还有一种利用了OpenCV。两种方式都需要简单的几行代码&#xff0c;这可能也就是现在Python那么流行的原…

鼠标移动到ul图片会摆动_我们可以从摆动时序分析中学到的三件事

鼠标移动到ul图片会摆动An opportunity for a new kind of analysis of Major League Baseball data may be upon us soon. Here’s how we can prepare.不久之后&#xff0c;我们将有机会对美国职棒大联盟数据进行新的分析。 这是我们准备的方法。 It is tempting to think t…

回到网易后开源APM技术选型与实战

篇幅一&#xff1a;APM基础篇\\1、什么是APM?\\APM&#xff0c;全称&#xff1a;Application Performance Management &#xff0c;目前市面的系统基本都是参考Google的Dapper&#xff08;大规模分布式系统的跟踪系统&#xff09;来做的&#xff0c;翻译传送门《google的Dappe…

如何选择优化算法遗传算法_用遗传算法优化垃圾收集策略

如何选择优化算法遗传算法Genetic Algorithms are a family of optimisation techniques that loosely resemble evolutionary processes in nature. It may be a crude analogy, but if you squint your eyes, Darwin’s Natural Selection does roughly resemble an optimisa…

PullToRefreshListView中嵌套ViewPager滑动冲突的解决

PullToRefreshListView中嵌套ViewPager滑动冲突的解决 最近恰好遇到PullToRefreshListView中需要嵌套ViewPager的情况,ViewPager 作为头部添加到ListView中&#xff0c;发先ViewPager在滑动过程中流畅性太差几乎很难左右滑动。在网上也看了很多大神的介绍&#xff0c;看了ViewP…

神经网络 卷积神经网络_如何愚弄神经网络?

神经网络 卷积神经网络Imagine you’re in the year 2050 and you’re on your way to work in a self-driving car (probably). Suddenly, you realize your car is cruising at 100KMPH on a busy road after passing through a cross lane and you don’t know why.想象一下…

数据特征分析-分布分析

分布分析用于研究数据的分布特征&#xff0c;常用分析方法&#xff1a; 1、极差 2、频率分布 3、分组组距及组数 df pd.DataFrame({编码:[001,002,003,004,005,006,007,008,009,010,011,012,013,014,015],\小区:[A村,B村,C村,D村,E村,A村,B村,C村,D村,E村,A村,B村,C村,D村,E村…

如何在Pandas中使用Excel文件

From what I have seen so far, CSV seems to be the most popular format to store data among data scientists. And that’s understandable, it gets the job done and it’s a quite simple format; in Python, even without any library, one can build a simple CSV par…

数据特征分析-对比分析

对比分析是对两个互相联系的指标进行比较。 绝对数比较(相减)&#xff1a;指标在量级上不能差别过大&#xff0c;常用折线图、柱状图 相对数比较(相除)&#xff1a;结构分析、比例分析、空间比较分析、动态对比分析 df pd.DataFrame(np.random.rand(30,2)*1000,columns[A_sale…

Linux基线合规检查中各文件的作用及配置脚本

1./etc/motd 操作&#xff1a;echo " Authorized users only. All activity may be monitored and reported " > /etc/motd 效果&#xff1a;telnet和ssh登录后的输出信息 2. /etc/issue和/etc/issue.net 操作&#xff1a;echo " Authorized users only. All…

tableau使用_使用Tableau升级Kaplan-Meier曲线

tableau使用In a previous article, I showed how we can create the Kaplan-Meier curves using Python. As much as I love Python and writing code, there might be some alternative approaches with their unique set of benefits. Enter Tableau!在上一篇文章中 &#x…

Nexus3.x.x上传第三方jar

exus3.x.x上传第三方jar&#xff1a; 1. create repository 选择maven2(hosted)&#xff0c;说明&#xff1a; proxy&#xff1a;即你可以设置代理&#xff0c;设置了代理之后&#xff0c;在你的nexus中找不到的依赖就会去配置的代理的地址中找hosted&#xff1a;你可以上传你自…

责备的近义词_考试结果危机:我们应该责备算法吗?

责备的近义词I’ve been considering writing on the topic of algorithms for a little while, but with the Exam Results Fiasco dominating the headline news in the UK during the past week, I felt that now is the time to look more closely into the subject.我一直…

c/c++编译器的安装

MinGW(Minimalist GNU For Windows)是个精简的Windows平台C/C、ADA及Fortran编译器&#xff0c;相比Cygwin而言&#xff0c;体积要小很多&#xff0c;使用较为方便。 MinGW最大的特点就是编译出来的可执行文件能够独立在Windows上运行。 MinGW的组成&#xff1a; 编译器(支持C、…

numpy 线性代数_数据科学家的线性代数—用NumPy解释

numpy 线性代数Machine learning and deep learning models are data-hungry. The performance of them is highly dependent on the amount of data. Thus, we tend to collect as much data as possible in order to build a robust and accurate model. Data is collected i…

spring 注解方式配置Bean

概要&#xff1a; 再classpath中扫描组件 组件扫描&#xff08;component scanning&#xff09;&#xff1a;Spring可以从classpath下自己主动扫描。侦測和实例化具有特定注解的组件特定组件包含&#xff1a; Component&#xff1a;基本注解。标示了一个受Spring管理的组件&…

零元学Expression Blend 4 - Chapter 25 以Text相关功能就能简单做出具有设计感的登入画面...

原文:零元学Expression Blend 4 - Chapter 25 以Text相关功能就能简单做出具有设计感的登入画面本章将交大家如何运用Blend 4 内的Text相关功能做出有设计感的登入画面 让你五分钟就能快速做出一个登入画面 ? 本章将教大家如何运用Blend 4 内的Text相关功能做出有设计感的登入…