Data Analyst Flashcards

1
Q

Що таке генеральне середнє?

A

це середнє арифметичне варіант ознак

1/N * (sum(xi)) N - об’єм генеральної суккупності

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to read csv file? [Pandas]

A

import pandas as pd

data = pd.read_csv(‘path_name’, sep=’;’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Get first / last n rows in data? [pandas]

A

data. head(5)

data. tail(5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to replace NaN with zeroes? [pandas]

[2 options]

A

data. replace(np.nan, 0)

data. fillna(0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to convert column to float? [pandas]

A

dataset[column_name] = dataset[column_name] \
.str.replace(‘,’, ‘.’) \
.astype(float)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to sort rows by some columns? [pandas]

A

dataset.sort_values(by=[sortBy], ascending=False)[[‘Country Name’, sortBy]]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to find max element (its index) in data? [pandas]

how we can get that row?

A

data[‘Area’].idxmin()

data.iloc[ind_min_area][0]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to replace nan with column mean? [pandas]

A

data.replace(np.nan, data.mean())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to count total amounts for each values? [pandas]

Ex: T T K -> T = 2 K = 1

A

data[‘Populatiion’].value_counts()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to group by? [pandas]

A

groupedData = data.groupby(‘Region’)[‘Area’].mean()

print(str(groupedData.idxmax()) + ‘ that has ‘ + str(groupedData.max()))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly