Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ flask_project/ven/lib
numpy.ipynb
.ipynb_checkpoints
.vscode/
*~
test.py
16 changes: 8 additions & 8 deletions 18_Day_Regular_expressions/18_regular_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ To find a pattern we use different set of *re* character sets that allows to sea
#### Match

```py
# syntac
# syntax
re.match(substring, string, re.I)
# substring is a string or a pattern, string is the text we look for a pattern , re.I is case ignore
```
Expand Down Expand Up @@ -189,9 +189,9 @@ Let us add one more example. The following string is really hard to read unless

```py

txt = '''%I a%m te%%a%%che%r% a%n%d %% I l%o%ve te%ach%ing.
txt = '''%I a%m te%%a%%che%r% a%n%d %% I l%o%ve te%ach%ing.
T%he%re i%s n%o%th%ing as r%ewarding a%s e%duc%at%i%ng a%n%d e%m%p%ow%er%ing p%e%o%ple.
I fo%und te%a%ching m%ore i%n%t%er%%es%ting t%h%an any other %jobs.
I fo%und te%a%ching m%ore i%n%t%er%%es%ting t%h%an any other %jobs.
D%o%es thi%s m%ot%iv%a%te %y%o%u to b%e a t%e%a%cher?'''

matches = re.sub('%', '', txt)
Expand All @@ -200,7 +200,7 @@ print(matches)

```sh
I am teacher and I love teaching.
There is nothing as rewarding as educating and empowering people.
There is nothing as rewarding as educating and empowering people.
I found teaching more interesting than any other jobs. Does this motivate you to be a teacher?
```

Expand All @@ -221,7 +221,7 @@ print(re.split('\n', txt)) # splitting using \n - end of line symbol
## Writing RegEx Patterns

To declare a string variable we use a single or double quote. To declare RegEx variable *r''*.
The following pattern only identifies apple with lowercase, to make it case insensitive either we should rewrite our pattern or we should add a flag.
The following pattern only identifies apple with lowercase, to make it case insensitive either we should rewrite our pattern or we should add a flag.

```py
import re
Expand Down Expand Up @@ -322,7 +322,7 @@ txt = '''Apple and banana are fruits'''
matches = re.findall(regex_pattern, txt)
print(matches) # ['an', 'an', 'an', 'a ', 'ar']

regex_pattern = r'[a].+' # . any character, + any character one or more times
regex_pattern = r'[a].+' # . any character, + any character one or more times
matches = re.findall(regex_pattern, txt)
print(matches) # ['and banana are fruits']
```
Expand All @@ -332,7 +332,7 @@ print(matches) # ['and banana are fruits']
Zero or many times. The pattern could may not occur or it can occur many times.

```py
regex_pattern = r'[a].*' # . any character, * any character zero or more times
regex_pattern = r'[a].*' # . any character, * any character zero or more times
txt = '''Apple and banana are fruits'''
matches = re.findall(regex_pattern, txt)
print(matches) # ['and banana are fruits']
Expand Down Expand Up @@ -369,7 +369,7 @@ print(matches) # ['6', '2019', '8', '2021']
### Cart ^

- Starts with

```py
txt = 'This regular expression example was made on December 6, 2019 and revised on July 8, 2021'
regex_pattern = r'^This' # ^ means starts with
Expand Down
4 changes: 2 additions & 2 deletions 24_Day_Statistics/24_statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ Numpy is equipped with the robust statistical function as listed below
- Max np.max()
- Mean np.mean()
- Median np.median()
- Varience
- Variance
- Percentile
- Standard deviation np.std()

Expand Down Expand Up @@ -1203,7 +1203,7 @@ plt.show()

![png](../test_files/test_141_0.png)

To draw the Gaussian normal distribution using numpy. As you can see below, the numpy can generate random numbers. To create random sample, we need the mean(mu), sigma(standard deviation), mumber of data points.
To draw the Gaussian normal distribution using numpy. As you can see below, the numpy can generate random numbers. To create random sample, we need the mean(mu), sigma(standard deviation), number of data points.

```python
mu = 28
Expand Down
36 changes: 18 additions & 18 deletions 25_Day_Pandas/25_pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
- [Creating a DataFrame](#creating-a-dataframe)
- [Adding a New Column](#adding-a-new-column)
- [Modifying column values](#modifying-column-values)
- [Formating DataFrame columns](#formating-dataframe-columns)
- [Formatting DataFrame columns](#formatting-dataframe-columns)
- [Checking data types of Column values](#checking-data-types-of-column-values)
- [Boolean Indexing](#boolean-indexing)
- [Exercises: Day 25](#exercises-day-25)

# 📘 Day 25

## Pandas

Pandas is an open source, high-performance, easy-to-use data structures and data analysis tools for the Python programming language.
Pandas adds data structures and tools designed to work with table-like data which is *Series* and *Data Frames*.
Pandas provides tools for data manipulation:
Pandas provides tools for data manipulation:

- reshaping
- merging
Expand All @@ -72,18 +72,18 @@ pip install conda
pip install pandas
```

Pandas data structure is based on *Series* and *DataFrames*.
Pandas data structure is based on *Series* and *DataFrames*.

A *series* is a *column* and a DataFrame is a *multidimensional table* made up of collection of *series*. In order to create a pandas series we should use numpy to create a one dimensional arrays or a python list.
Let us see an example of a series:

Names Pandas Series

![pandas series](../images/pandas-series-1.png)
![pandas series](../images/pandas-series-1.png)

Countries Series

![pandas series](../images/pandas-series-2.png)
![pandas series](../images/pandas-series-2.png)

Cities Series

Expand Down Expand Up @@ -216,7 +216,7 @@ Pandas data frames can be created in different ways.

```python
data = [
['Asabeneh', 'Finland', 'Helsink'],
['Asabeneh', 'Finland', 'Helsink'],
['David', 'UK', 'London'],
['John', 'Sweden', 'Stockholm']
]
Expand Down Expand Up @@ -455,7 +455,7 @@ print(df.tail()) # tails give the last five rows, we can increase the rows by pa
</tbody>
</table>

As you can see the csv file has three rows: Gender, Height and Weight. If the DataFrame would have a long rows, it would be hard to know all the columns. Therefore, we should use a method to know the colums. we do not know the number of rows. Let's use shape meathod.
As you can see the csv file has three rows: Gender, Height and Weight. If the DataFrame would have a long rows, it would be hard to know all the columns. Therefore, we should use a method to know the columns. we do not know the number of rows. Let's use shape method.

```python
print(df.shape) # as you can see 10000 rows and three columns
Expand Down Expand Up @@ -487,7 +487,7 @@ print(heights)
2 74.110105
3 71.730978
4 69.881796
...
...
9995 66.172652
9996 67.067155
9997 63.867992
Expand All @@ -510,7 +510,7 @@ print(weights)
2 212.740856
3 220.042470
4 206.349801
...
...
9995 136.777454
9996 170.867906
9997 128.475319
Expand All @@ -528,7 +528,7 @@ print(len(heights) == len(weights))
The describe() method provides a descriptive statistical values of a dataset.

```python
print(heights.describe()) # give statisical information about height data
print(heights.describe()) # give statistical information about height data
```

```sh
Expand Down Expand Up @@ -621,9 +621,9 @@ Similar to describe(), the info() method also give information about the dataset

Modifying a DataFrame:
* We can create a new DataFrame
* We can create a new column and add it to the DataFrame,
* we can remove an existing column from a DataFrame,
* we can modify an existing column in a DataFrame,
* We can create a new column and add it to the DataFrame,
* we can remove an existing column from a DataFrame,
* we can modify an existing column in a DataFrame,
* we can change the data type of column values in the DataFrame

### Creating a DataFrame
Expand Down Expand Up @@ -828,7 +828,7 @@ def calculate_bmi ():
b = w/(h*h)
bmi.append(b)
return bmi

bmi = calculate_bmi()

```
Expand Down Expand Up @@ -882,7 +882,7 @@ df
</tbody>
</table>

### Formating DataFrame columns
### Formatting DataFrame columns

The BMI column values of the DataFrame are float with many significant digits after decimal. Let's change it to one significant digit after point.

Expand Down Expand Up @@ -1102,7 +1102,7 @@ print(df)
</tbody>
</table>

The person in the first row lived so far for 251 years. It is unlikely for someone to live so long. Either it is a typo or the data is cooked. So lets fill that data with average of the columns without including outlier.
The person in the first row lived so far for 251 years. It is unlikely for someone to live so long. Either it is a typo or the data is cooked. So lets fill that data with average of the columns without including outlier.

mean = (35 + 30)/ 2

Expand Down Expand Up @@ -1202,7 +1202,7 @@ print(df[df['Ages'] < 120])

## Exercises: Day 25

1. Read the hacker_news.csv file from data directory
1. Read the hacker_news.csv file from data directory
1. Get the first five rows
1. Get the last five rows
1. Get the title column as pandas series
Expand Down
2 changes: 1 addition & 1 deletion 29_Day_Building_API/29_building_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ By connecting the flask, we can fetch students collection data from the thirty_d

### Getting a document by id

We can access signle document using an id, let's access Asabeneh using his id.
We can access single document using an id, let's access Asabeneh using his id.
http://localhost:5000/api/v1.0/students/5df68a21f106fe2d315bbc8b

```py
Expand Down
4 changes: 2 additions & 2 deletions 30_Day_Conclusions/30_conclusions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/asabeneh?style=social">
</a>


<sub>Author:
<a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br>
<small>Second Edition: July, 2021</small>
Expand All @@ -31,7 +31,7 @@
In the process of preparing this material I have learned quite a lot and you have inspired me to do more. Congratulations for making it to this level. If you have done all the exercise and the projects, now you are capable to go to a data analysis, data science, machine learning or web development paths. [Support the author for more educational materials](https://www.paypal.com/paypalme/asabeneh).

## Testimony
Now it is time to express your thoughts about the Author and 30DaysOfPyhton. You can leave your testimonial on this [link](https://www.asabeneh.com/testimonials)
Now it is time to express your thoughts about the Author and 30DaysOfPython. You can leave your testimonial on this [link](https://www.asabeneh.com/testimonials)

GIVE FEEDBACK:
http://thirtydayofpython-api.herokuapp.com/feedback
Expand Down
24 changes: 12 additions & 12 deletions Korean/readme_ko.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🐍 30 Days Of Python
# 🐍 30 Days Of Python

|# Day | Topics |
|------|:---------------------------------------------------------:|
Expand All @@ -15,11 +15,11 @@
| 11 | [Functions](../11_Day_Functions/11_functions.md)|
| 12 | [Modules](../12_Day_Modules/12_modules.md)|
| 13 | [List Comprehension](../13_Day_List_comprehension/13_list_comprehension.md)|
| 14 | [Higher Order Functions](../14_Day_Higher_order_functions/14_higher_order_functions.md)|
| 15 | [Python Type Errors](../15_Day_Python_type_errors/15_python_type_errors.md)|
| 16 | [Python Date time](../16_Day_Python_date_time/16_python_datetime.md) |
| 17 | [Exception Handling](../17_Day_Exception_handling/17_exception_handling.md)|
| 18 | [Regular Expressions](../18_Day_Regular_expressions/18_regular_expressions.md)|
| 14 | [Higher Order Functions](../14_Day_Higher_order_functions/14_higher_order_functions.md)|
| 15 | [Python Type Errors](../15_Day_Python_type_errors/15_python_type_errors.md)|
| 16 | [Python Date time](../16_Day_Python_date_time/16_python_datetime.md) |
| 17 | [Exception Handling](../17_Day_Exception_handling/17_exception_handling.md)|
| 18 | [Regular Expressions](../18_Day_Regular_expressions/18_regular_expressions.md)|
| 19 | [File Handling](../19_Day_File_handling/19_file_handling.md)|
| 20 | [Python Package Manager](../20_Day_Python_package_manager/20_python_package_manager.md)|
| 21 | [Classes and Objects](../21_Day_Classes_and_objects/21_classes_and_objects.md)|
Expand All @@ -36,7 +36,7 @@
🧡🧡🧡 HAPPY CODING 🧡🧡🧡

<div>
<small>Support the <strong>author</strong> to create more educational materials</small> <br />
<small>Support the <strong>author</strong> to create more educational materials</small> <br />
<a href = "https://www.paypal.me/asabeneh"><img src='../images/paypal_lg.png' alt='Paypal Logo' style="width:10%"/></a>
</div>

Expand Down Expand Up @@ -95,7 +95,7 @@

_30 days of Python_에 참여하기로 결정하신 것을 **축하드립니다**. 이 챌린지에서는 Python 프로그래머가 되기 위해 필요한 모든 것과 프로그래밍의 전체 개념을 배우게 됩니다. 챌린지가 끝나면 _30DaysOfPython_프로그래밍 챌린지 인증서를 받게 됩니다.

챌린지에 적극적으로 참여하고 싶다면 [30DaysOfPython challenge](https://t.me/ThirtyDaysOfPython) 텔레그램 그룹에 가입할 수 있습니다.
챌린지에 적극적으로 참여하고 싶다면 [30DaysOfPython challenge](https://t.me/ThirtyDaysOfPython) 텔레그램 그룹에 가입할 수 있습니다.

## 소개

Expand Down Expand Up @@ -334,8 +334,8 @@ Python 사전 개체는 키 값 쌍 형식의 정렬되지 않은 데이터 모
{
'first_name':'Asabeneh',
'last_name':'Yetayeh',
'country':'Finland',
'age':250,
'country':'Finland',
'age':250,
'is_married':True,
'skills':['JS', 'React', 'Node', 'Python']
}
Expand Down Expand Up @@ -447,8 +447,8 @@ Python 파일을 실행하려면 아래 이미지를 확인하세요. Visual Stu
### Exercise: Level 3

1. Number(Integer, Float, Complex), String, Boolean, List, Tuple, Set 및 Dictionary와 같은 다양한 Python 데이터 유형에 대한 예제를 작성합니다.
2. 참고 [Euclidian distance](https://en.wikipedia.org/wiki/Euclidean_distance#:~:text=In%20mathematics%2C%20the%20Euclidean%20distance,being%20called%20the%20Pythagorean%20distance.) (2, 3) 과 (10, 8) 사이
2. 참고 [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance#:~:text=In%20mathematics%2C%20the%20Euclidean%20distance,being%20called%20the%20Pythagorean%20distance.) (2, 3) 과 (10, 8) 사이

🎉 축하합니다 ! 🎉

[Day 2 >>](../02_Day_Variables_builtin_functions/02_variables_builtin_functions.md)
[Day 2 >>](../02_Day_Variables_builtin_functions/02_variables_builtin_functions.md)
2 changes: 1 addition & 1 deletion numpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ print('The size:', two_dimensional_list.size) # 3

## Mathematical Operation using numpy

Numpy array is not like exactly like python list. To do mathematical operation in pyhton list we have to loop through the items but numpy can allow to do any mathematical operation without looping.
Numpy array is not like exactly like python list. To do mathematical operation in python list we have to loop through the items but numpy can allow to do any mathematical operation without looping.
Mathematical Operation:

- Addition (+)
Expand Down
Loading