Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: matplotlib x-axis text move bottom upward
Post: RE: matplotlib x-axis text move bottom upward
I try with this seems like it work:
plt.figure(figsize=(15, 6.5))x = np.arange(len(datetime))
plt.figure(figsize=(15, 6.5))
# Plot the line graph
plt.plot(datetime, tput, label='DL')
plt.xlabel('time'... |
|
jacklee26 |
General Coding Help |
3 |
995 |
May-31-2023, 04:28 AM |
|
|
Thread: matplotlib x-axis text move bottom upward
Post: RE: matplotlib x-axis text move bottom upward
(May-30-2023, 12:08 PM)Gribouillis Wrote: Try this perhaps.
i try using plt.tight_layout() xaxis word will show
but is there any method to adjust the graph like attached picture resize.PNG |
|
jacklee26 |
General Coding Help |
3 |
995 |
May-31-2023, 12:34 AM |
|
|
Thread: matplotlib x-axis text move bottom upward
Post: matplotlib x-axis text move bottom upward
Does anyone know how to resize the bottom of my x-axis u, it seem like the x-axis all text word is showing all of them out.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# R... |
|
jacklee26 |
General Coding Help |
3 |
995 |
May-30-2023, 07:59 AM |
|
|
Thread: convert string to float in list
Post: RE: convert string to float in list
ok Thanks all,
I solve it by adding this
import pandas as pd
#uplink
df1 = pd.DataFrame(UL)
df1 = df1.rename(columns=df1.iloc[0]).drop(df1.index[0])
df1['ingress-traffic'] = df1['ingress-traffic'].... |
|
jacklee26 |
General Coding Help |
6 |
1,922 |
Feb-13-2023, 01:14 AM |
|
|
Thread: convert string to float in list
Post: RE: convert string to float in list
I saw my dtypes are object. IS there any method to change column 2 and 3 to float.if there're any better methods or suggestions for this code please recommend them. I know this code is not pretty eff... |
|
jacklee26 |
General Coding Help |
6 |
1,922 |
Feb-11-2023, 01:48 AM |
|
|
Thread: convert string to float in list
Post: convert string to float in list
HI
Do anyone know how to convert element in the list to float, and write them into excel?
My code will read a file and write it into excel, attached picture. But I wish to convert the red mark into ... |
|
jacklee26 |
General Coding Help |
6 |
1,922 |
Feb-10-2023, 10:43 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
hi i have some questions about the index s1 = result[:3]
what if my file have more than 3 line, if my text file as below
datetime name department
20220101 James IT
20220101 Test IT
20220101 Test IT
20... |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-21-2023, 06:57 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
Thanks a lot,it work this time. I will try to study this. |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-11-2023, 12:31 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
(Jan-07-2023, 01:20 PM)snippsat Wrote: (Jan-07-2023, 09:13 AM)jacklee26 Wrote: when i run it occur this error, do you know how to fix this
FutureWarning: save is not part of the public API, usage... |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-10-2023, 08:07 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
(Jan-07-2023, 12:10 AM)snippsat Wrote: Can show a way,so output is like in the image.
import pandas as pd
with open("pd.txt") as f:
result = [i.strip('================') for i in f]
# Clean up... |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-07-2023, 09:13 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
What if i don't want to have multiply sheet, I only wants to have two sheet, when ever see the "=" after that line add into new sheet. Seem like this code will add new sheet to every line. |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-05-2023, 09:46 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: RE: how to read txt file, and write into excel wit...
HI gradlon93,
thanks for reply
is it possible to do like the attached picture, i am still figuring it out, but still have no idea.
[attachment=2173] |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-05-2023, 01:12 AM |
|
|
Thread: how to read txt file, and write into excel with multiply sheet
Post: how to read txt file, and write into excel with mu...
Hi I have faced one problem I wish to read a text file, and when reaching ===== ending, I wish to write into a new separate sheet.
So for example, If I have a text file like below this:
datetime nam... |
|
jacklee26 |
General Coding Help |
14 |
10,041 |
Jan-01-2023, 03:41 AM |
|
|
Thread: openpyxl convert data to float
Post: RE: openpyxl convert data to float
(Nov-09-2022, 03:25 PM)deanhystad Wrote: (Nov-09-2022, 07:36 AM)jacklee26 Wrote: i have one more question what if my first second row is =====, how to able to implement, like this:
[inline]
atetti... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-19-2022, 08:23 AM |
|
|
Thread: openpyxl convert data to float
Post: RE: openpyxl convert data to float
(Nov-09-2022, 03:24 AM)rob101 Wrote: You're welcome.
Yes, there's a better way: what you could do is to modify the code so that the first readline() (which you know will be the column headers) is p... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-09-2022, 07:36 AM |
|
|
Thread: openpyxl convert data to float
Post: RE: openpyxl convert data to float
(Nov-09-2022, 05:58 AM)deanhystad Wrote: If I was forced to write a converter instead of using the great one provided by pandas, it might look like this:
import openpyxl
from openpyxl.styles import ... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-09-2022, 07:29 AM |
|
|
Thread: openpyxl convert data to float
Post: RE: openpyxl convert data to float
(Nov-09-2022, 12:37 AM)rob101 Wrote: Almost: line 10 should be list123[2] = float(list123[2])
Thanks,
Have to use if else, is there any better way because if there're many columns I have to write ma... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-09-2022, 02:07 AM |
|
|
Thread: openpyxl convert data to float
Post: RE: openpyxl convert data to float
HI Thanks for your answer. What if I have another column the same as the second column?
Output:datettime Tput Tput2
20221018.165317.401555 0.000545 0.000545
20221018.165327.401723... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-09-2022, 12:25 AM |
|
|
Thread: openpyxl convert data to float
Post: openpyxl convert data to float
i have problem-related with excel, it seems like convert from txt to excel the data is a string not float. Is there any solution to convert it to float?
I have a text file name result.txt as below
d... |
|
jacklee26 |
General Coding Help |
13 |
6,023 |
Nov-08-2022, 05:20 AM |
|
|
Thread: convert this List Comprehensions to loop
Post: RE: convert this List Comprehensions to loop
(Oct-20-2022, 04:46 AM)rob101 Wrote: As already stated, there's an error (a typo, maybe?)
This is how I would do it:
results = ['A', 'B', 'C', 'D']
for index, c in enumerate(results):
if index... |
|
jacklee26 |
General Coding Help |
8 |
1,512 |
Oct-21-2022, 01:14 PM |