Aşağıda vermiş olduğum kod ile karakteri düzeltip kullanabilirsiniz
convmv -r --notest -f windows-1252 -t UTF-8 *
Kendim için aldığım notları sizin ile paylaşıyorum. Genel olarak ilgi alanlarım yapay zeka, büyük veri ve mobil uygulamalar.
convmv -r --notest -f windows-1252 -t UTF-8 *
Grab data from multiple excel files and merge them into a single dataframe.
import pandas as pd
import matplotlib
import os
import sys
%matplotlib inline
print('Python version ' + sys.version)
print('Pandas version ' + pd.__version__)
print('Matplotlib version ' + matplotlib.__version__)
Python version 3.5.1 |Anaconda custom (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] Pandas version 0.20.1 Matplotlib version 1.5.1
# Create DataFrame
d = {'Channel':[1], 'Number':[255]}
df = pd.DataFrame(d)
df
| Channel | Number | |
|---|---|---|
| 0 | 1 | 255 |
# Export to Excel
df.to_excel('test1.xlsx', sheet_name = 'test1', index = False)
df.to_excel('test2.xlsx', sheet_name = 'test2', index = False)
df.to_excel('test3.xlsx', sheet_name = 'test3', index = False)
print('Done')
Done
# List to hold file names
FileNames = []
# Your path will be different, please modify the path below.
os.chdir(r"C:\Users\david\notebooks\update")
# Find any file that ends with ".xlsx"
for files in os.listdir("."):
if files.endswith(".xlsx"):
FileNames.append(files)
FileNames
['test1.xlsx', 'test2.xlsx', 'test3.xlsx']
def GetFile(fnombre):
# Path to excel file
# Your path will be different, please modify the path below.
location = r'C:\Users\david\notebooks\update\\' + fnombre
# Parse the excel file
# 0 = first sheet
df = pd.read_excel(location, 0)
# Tag record to file name
df['File'] = fnombre
# Make the "File" column the index of the df
return df.set_index(['File'])
# Create a list of dataframes
df_list = [GetFile(fname) for fname in FileNames]
df_list
[ Channel Number File test1.xlsx 1 255, Channel Number File test2.xlsx 1 255, Channel Number File test3.xlsx 1 255]
# Combine all of the dataframes into one
big_df = pd.concat(df_list)
big_df
| Channel | Number | |
|---|---|---|
| File | ||
| test1.xlsx | 1 | 255 |
| test2.xlsx | 1 | 255 |
| test3.xlsx | 1 | 255 |
big_df.dtypes
Channel int64 Number int64 dtype: object
# Plot it!
big_df['Channel'].plot.bar();
import pandas as pd
import sys
print('Python version ' + sys.version)
print('Pandas version ' + pd.__version__)
Python version 3.5.1 |Anaconda custom (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] Pandas version 0.20.1
# Create DataFrame
d = [1,2,3,4,5,6,7,8,9]
df = pd.DataFrame(d, columns = ['Number'])
df
| Number | |
|---|---|
| 0 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 4 |
| 4 | 5 |
| 5 | 6 |
| 6 | 7 |
| 7 | 8 |
| 8 | 9 |
# Export to Excel
df.to_excel('Lesson10.xlsx', sheet_name = 'testing', index = False)
print('Done')
Done
# Path to excel file
# Your path will be different, please modify the path below.
location = r'C:\Users\david\notebooks\update\Lesson10.xlsx'
# Parse the excel file
df = pd.read_excel(location, 0)
df.head()
| Number | |
|---|---|
| 0 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 4 |
| 4 | 5 |
df.dtypes
Number int64 dtype: object
df.tail()
| Number | |
|---|---|
| 4 | 5 |
| 5 | 6 |
| 6 | 7 |
| 7 | 8 |
| 8 | 9 |
df.to_json('Lesson10.json')
print('Done')
Done
# Your path will be different, please modify the path below.
jsonloc = r'C:\Users\david\notebooks\update\Lesson10.json'
# read json file
df2 = pd.read_json(jsonloc)
df2
| Number | |
|---|---|
| 0 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 4 |
| 4 | 5 |
| 5 | 6 |
| 6 | 7 |
| 7 | 8 |
| 8 | 9 |
df2.dtypes
Number int64 dtype: object
Git: Commit Yönetimi ve Rebase Rehberi Bu rehber, staged değişiklikleri koruma, commit sırasını değiştirme ve squash işlemlerini kapsamaktad...